ClaraBarton
Registered User.
- Local time
- Yesterday, 19:44
- Joined
- Oct 14, 2019
- Messages
- 654
I have a popup window that takes a recordset from the form and does optional things with it.
The following gives me a Data Type conversion error
Is it ok to pull out specific fields from an already existing recordset to export?
Or is there a better way?
The following gives me a Data Type conversion error
Is it ok to pull out specific fields from an already existing recordset to export?
Or is there a better way?
Code:
Dim strSql As String
Dim rstExport As Recordset
strSql = "SELECT [Contacts].[Company], [Contacts].[LastName], [Contacts].[FirstName], " _
& "[Contacts].[EMail], [Contacts].[Business], [Contacts].[Home], [Contacts].[Mobile], " _
& "[Contacts].[Address], [Contacts].[City], [Contacts].[State], [Contacts].[ZIP], " _
& "[Contacts].[Country], [Contacts].[Notes], [Contacts].[Category], " _
& "[Contacts].[NonGMO], [Contacts].[Organic] " _
& "FROM rst9;"
strPath = CurrentProject.Path & "\ExportTo.csv"
Set rstExport = rst9.OpenRecordset(strSql)
DoCmd.TransferText acExportDelim, , "rstExport", strPath, True