Hello Mr. Allen,
I think im succesful checking with spacing and commas and adding
Debug.Pring SQL....
the problem is i have this error now
Run time error '3051: The Microsoft Jet Database engine cannot open the file
"D:\Database\Export Folders\EXCEL\". It is already opened exlusively by
another user, or you need permission to view its data.
can you help what is this error all about????
or maybe i need arguments for my ..."D:\Database\Export Folders\EXCEL\"
i think i miss something here??????
****
Dim strSql As String
strSql = "SELECT* FROM [DCN01]"
With Me.Data_Entry2_subform.Form
If .FilterOn Then
strSql = strSql & " WHERE" & .Filter
End If
End With
Debug.Print SQL
strSql = strSql & " ORDER BY [Drawing Ref];"
CurrentDb.QueryDefs("qryExport").SQL = strSql
DoCmd.TransferSpreadsheet acImport, 8, "qryExport", _
"D:\Database\Export Folders\EXCEL\"
thanks again Mr. Allen Browne.....
***************************
Allen Browne said:
Add the line
Debug.Print strSql
When it fails, open the Immediate Window (press Ctrl+G), and look at what
came out.
For eample, you may have missed a space between words.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Denver said:
yes i have a query now name qryExport
i have this code but i have this error
Run-Time error 3131:Sytax error in FROM Clause.
then when i try ti debug it highlights this one
CurrentDb.QueryDefs("qryExport").SQL = strSql
******here is my code with this error*********
Dim strSql As String
strSql = "SELECT * FROM [DCN01]"
With Me.Data_Entry2_subform.Form
If .FilterOn Then
strSql = strSql & " WHERE" & .Filter
End If
End With
strSql = strSql & " ORDER BY [Drawing Ref];"
CurrentDb.QueryDefs("qryExport").SQL = strSql
DoCmd.TransferSpreadsheet acImport, 8, "qryExport", _
"D:\Database\Export Folders\EXCEL\"
can you help how to fix this........