Doug Murphy
dw-murphy at cox.net
Thu Jan 27 10:39:46 CST 2011
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#AccessImportFromExc 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