[AccessD] Set a form's recordset to an ADO recordset to viewrecords

Doug Murphy dw-murphy at cox.net
Thu Jan 27 22:57:22 CST 2011


I guess the problem is with me, I need to go back to fundamentals. I don't
typically use forms in datasheet mode. I was assuming that it would display
the recordset results without me putting all the controls on the form, like
the visual studio gridview. I do this same process on an ASP.NET page with
the gridview so was trying to duplicate the functionality in Access. I tried
just using a query as the recordsource for my display form and not placing
controls on the form and got the same results, so I guess it won't work.
I'll just load the rowsource of a list box by stepping through the first few
records and use that for my trial display.

Thanks 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Thursday, January 27, 2011 9:06 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Set a form's recordset to an ADO recordset to
viewrecords

What happens if you use a continuous form laid out to look like a datasheet?
I've never tried binding a datasheet to an ADO recordset, but I know forms
work.  And what version of Access?

Charlotte Foust

On Thu, Jan 27, 2011 at 8:39 AM, Doug Murphy <dw-murphy at cox.net> wrote:
> Hi Darryl,
>
> Thanks for the material. I can get the loaded recordset, what I want 
> to do is display the first ten rows or so in a datasheet so the user 
> can select the appropriate columns to import and select the table 
> field they should be imported into. The issue I am having is I can not 
> get the recordset to display on a form in datasheet mode. The form 
> shows that the records are there in displaying the record count and 
> the appropriate number of record selectors, but no data is shown. I can't
figure out what is going on.
>
> I'll keep your material for future reference. Good stuff.
>
> Doug
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darryl 
> Collins
> Sent: Wednesday, January 26, 2011 9:58 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Set a form's recordset to an ADO recordset to 
> view records
>
>
> ______________________________________________________________________
> ______
> ___________
>
> Note: This e-mail is subject to the disclaimer contained at the bottom 
> of this message.
> ______________________________________________________________________
> ______
> ___________
>
>
>
> Doug,
>
> have a peep here. It may be useful.
>
> <<http://www.excelyourbusiness.com.au/ms_access_page.htm#AccessImportF
> romExc
> el>>
>
> cheers
> darryl
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy
> Sent: Thursday, 27 January 2011 4:45 PM
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Set a form's recordset to an ADO recordset to view 
> records
>
> Folks,
>
> I am trying to create a form to review the first few rows of an excel 
> spreadsheet before going through an import process. These spread 
> sheets can be unstructured as far as which column is where and what 
> they are called so the user has to select which column goes in which field
in the import table.
> I open my ADO connection and get the field names and get a recordset 
> from the first work sheet. I them set it as the recordset of a form in 
> datasheet view expecting to see all the rows. The form loads the 
> recordset as I can see the row count and the record selectors, but I 
> can't see any fields in it. I can step through a recordset row in code 
> and verify that there are values. What am I missing to make the records
visible?
>
> Code snippet follows:
>
>      sStrQuery = " Select * FROM " & sSheetName & ""
>
>      Set rsF = New ADODB.Recordset
>      With rsF
>            .Source = sStrQuery
>            .ActiveConnection = cn
>            .LockType = adLockReadOnly
>            .CursorType = adOpenStatic
>            .Open
>      End With
>
>     Set Forms("frmImportVendorExcelDisplay").Recordset = rsF
>           Forms("frmImportVendorExcelDisplay").Refresh
>
> Doug
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com 
> ______________________________________________________________________
> ______
> ___________
>
> The information transmitted in this message and its attachments (if 
> any) is intended only for the person or entity to which it is addressed.
> The message may contain confidential and/or privileged material. Any 
> review, retransmission, dissemination or other use of, or taking of 
> any action in reliance upon this information, by persons or entities 
> other than the intended recipient is prohibited.
>
> If you have received this in error, please contact the sender and 
> delete this e-mail and associated material from any computer.
>
> The intended recipient of this e-mail may only use, reproduce, 
> disclose or distribute the information contained in this e-mail and 
> any attached files, with the permission of the sender.
>
> This message has been scanned for viruses.
> ______________________________________________________________________
> ______
> ___________
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list