Problem:
I need to export data from Access that is created on the fly. This is to be written to a text file. I can create a file but I need to append successive data to the file as it runs through the loop.
Current Code:
The data set is generated with select criteria and creates a list.
For Each varItem In Forms![frm_date_year]![lstSelect].ItemsSelected
strRig = Forms![frm_date_year]![lstSelect].ItemData(varItem)
Forms![frm_date_year]![txtholditem] = strRig
DoCmd.OpenQuery "qry_export"
DoCmd.Close acQuery, "qry_export"
DoCmd.TransferText acExportFixed, "export WSN", "qry_export", "filename.txt", False, ""
Next
Can anyone help ?????
Thanks
I need to export data from Access that is created on the fly. This is to be written to a text file. I can create a file but I need to append successive data to the file as it runs through the loop.
Current Code:
The data set is generated with select criteria and creates a list.
For Each varItem In Forms![frm_date_year]![lstSelect].ItemsSelected
strRig = Forms![frm_date_year]![lstSelect].ItemData(varItem)
Forms![frm_date_year]![txtholditem] = strRig
DoCmd.OpenQuery "qry_export"
DoCmd.Close acQuery, "qry_export"
DoCmd.TransferText acExportFixed, "export WSN", "qry_export", "filename.txt", False, ""
Next
Can anyone help ?????
Thanks