F
Freeflyer
Hi,
I am using TransferText to export the results of a query to a CSV file.
Originally, I was using the TransferTextType acExportDelim, but this enclosed
th exported fields in quotations marks which is not suitable for my purposes.
I then used the export text wizard to create a new export specification,
without any text qualifier, which I called acExportPricesheet.
However, when I changed the TransferText command to use the new
specification I now receive an error message:
"Run-time error '3073':
operation must use an updateable query."
Can anyone explain what is causing this error and how to fix it? The query
that is being exported should not be updated by the export. I've included by
code below.
Thanks,
Michael
*** VBA Code ***
Private Sub cmdExport_Click()
Dim strFilter As String
Dim lngFlags As Long
Dim intWindowHandle As Long
intWindowHandle = Screen.ActiveForm.hwnd
strFilter = ahtAddFilterItem(strFilter, "CSV Files (*.csv)", "*.CSV")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
ahtCommonFileOpenSave(Flags:=lngFlags, InitialDir:="H:\My Documents\",
Filter:=strFilter, FilterIndex:=3, DefaultExt:="csv",
FileName:="Pricesheet.csv", DialogTitle:="Save Pricesheet as...",
hwnd:=intWindowHandle, OpenFile:=False)
End Sub
*** End Code ***
I'm using the Open/Save file API from http://www.mvps.org/access/ to obtain
the filename to export to.
I am using TransferText to export the results of a query to a CSV file.
Originally, I was using the TransferTextType acExportDelim, but this enclosed
th exported fields in quotations marks which is not suitable for my purposes.
I then used the export text wizard to create a new export specification,
without any text qualifier, which I called acExportPricesheet.
However, when I changed the TransferText command to use the new
specification I now receive an error message:
"Run-time error '3073':
operation must use an updateable query."
Can anyone explain what is causing this error and how to fix it? The query
that is being exported should not be updated by the export. I've included by
code below.
Thanks,
Michael
*** VBA Code ***
Private Sub cmdExport_Click()
Dim strFilter As String
Dim lngFlags As Long
Dim intWindowHandle As Long
intWindowHandle = Screen.ActiveForm.hwnd
strFilter = ahtAddFilterItem(strFilter, "CSV Files (*.csv)", "*.CSV")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
ahtCommonFileOpenSave(Flags:=lngFlags, InitialDir:="H:\My Documents\",
Filter:=strFilter, FilterIndex:=3, DefaultExt:="csv",
FileName:="Pricesheet.csv", DialogTitle:="Save Pricesheet as...",
hwnd:=intWindowHandle, OpenFile:=False)
End Sub
*** End Code ***
I'm using the Open/Save file API from http://www.mvps.org/access/ to obtain
the filename to export to.