S
shaggles
I'm having a problem running a very simple SQL query in
VB. It runs fine on it's own but when I try to run it in
VB I get an 'object does not exist' error message. Can
anyone tell me what I'm doing wrong? Here's my code:
Function Backup_Exam_Data()
On Error GoTo Err_Backup
Dim strExam
Dim strDate As Date
MsgBox "Please insert disk in drive A."
strDate = InputBox("Enter date of earliest exam or trade
review.")
strExam = "SELECT * FROM tblCombinedExam WHERE
ExamDate>=strDate;"
DoCmd.TransferSpreadsheet acExport, 8,
strExam, "A:\ExamBackup" & Format(Date, "mmddyy")
& ".xls", True
Exit_Backup:
Exit Function
Err_Backup:
MsgBox Err.Description
Resume Exit_Backup
End Function
VB. It runs fine on it's own but when I try to run it in
VB I get an 'object does not exist' error message. Can
anyone tell me what I'm doing wrong? Here's my code:
Function Backup_Exam_Data()
On Error GoTo Err_Backup
Dim strExam
Dim strDate As Date
MsgBox "Please insert disk in drive A."
strDate = InputBox("Enter date of earliest exam or trade
review.")
strExam = "SELECT * FROM tblCombinedExam WHERE
ExamDate>=strDate;"
DoCmd.TransferSpreadsheet acExport, 8,
strExam, "A:\ExamBackup" & Format(Date, "mmddyy")
& ".xls", True
Exit_Backup:
Exit Function
Err_Backup:
MsgBox Err.Description
Resume Exit_Backup
End Function