I have the following code:
The problem is that I get an error message that states "DB engine could not find the object frmPriceUSF, make sure that the object exists etc. etc.
Well this is a valid form that does exist and yes the name is spelled correctly in the code.
I've used this code to transfer querys to an excel spreadsheet and no problem the code does the job.
In fact if I change the stDocName variable to qryPriceABC which is another object in the database the code runs fine.
Is there a different syntax for exporting form objects?
Any help would be appreciated.
Thank You
Code:
Private Sub Command71_Click()
On Error GoTo Err_Command71_Click
Dim stDocName As String
stDocName = "frmPriceUSF"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
stDocName, "C:\Documents and Settings\Administrator\Desktop\SIZZLER\INVENTORY\PricesUSF.xlsx"
MsgBox "Spreadsheet was created."
Exit_Command71_Click:
Exit Sub
Err_Command71_Click:
MsgBox Err.Description
Resume Exit_Command71_Click
End Sub
The problem is that I get an error message that states "DB engine could not find the object frmPriceUSF, make sure that the object exists etc. etc.
Well this is a valid form that does exist and yes the name is spelled correctly in the code.
I've used this code to transfer querys to an excel spreadsheet and no problem the code does the job.
In fact if I change the stDocName variable to qryPriceABC which is another object in the database the code runs fine.
Is there a different syntax for exporting form objects?
Any help would be appreciated.
Thank You