Darryl Collins
Darryl.Collins at iag.com.au
Wed Jan 26 23:57:32 CST 2011
_______________________________________________________________________________________ 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#AccessImportFromExcel>> 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. _______________________________________________________________________________________