S
SDIrby
Good Morning,
I have a database that imports an excel file, runs queries and othe
things, then saves the results in an excel file. What my problem is i
that i want a message box to appear when the file for that day alread
exist. So i'd like to check to see if it's there first, and if so the
to give the option to save over. Here is my code so far, it's on
command button.
'This is a check to see if the file has been saved previously
Dim Response As Variant
'See if the file exist in the specified location
'If Response = vbYes Then
'If (Dir("C:\Saneladb_" & Format(Date, "mm.dd.yy") & ".xls"))
true Then
Response = MsgBox("This file has been previously saved! Woul
you like to save anyway?", vbYesNo + vbExclamation, "Warning!")
If Response = vbYes Then
'DoCmd.TransferSpreadsheet acExport, 0, "tbl_Import_data"
"C:\Saneladb_" & Format(Date, "mm.dd.yy") & ".xls", True
Else
'Save over previously saved file
DoCmd.TransferSpreadsheet acExport, 0, "tbl_Import_data"
"C:\Saneladb_" & Format(Date, "mm.dd.yy") & ".xls", True
End If
Any help would be greatly appreciated. IT doesn't even seem to do th
check. And it saves anyway. Thank you for your time!
-a clean desk is the work of an idle mind
I have a database that imports an excel file, runs queries and othe
things, then saves the results in an excel file. What my problem is i
that i want a message box to appear when the file for that day alread
exist. So i'd like to check to see if it's there first, and if so the
to give the option to save over. Here is my code so far, it's on
command button.
'This is a check to see if the file has been saved previously
Dim Response As Variant
'See if the file exist in the specified location
'If Response = vbYes Then
'If (Dir("C:\Saneladb_" & Format(Date, "mm.dd.yy") & ".xls"))
true Then
Response = MsgBox("This file has been previously saved! Woul
you like to save anyway?", vbYesNo + vbExclamation, "Warning!")
If Response = vbYes Then
'DoCmd.TransferSpreadsheet acExport, 0, "tbl_Import_data"
"C:\Saneladb_" & Format(Date, "mm.dd.yy") & ".xls", True
Else
'Save over previously saved file
DoCmd.TransferSpreadsheet acExport, 0, "tbl_Import_data"
"C:\Saneladb_" & Format(Date, "mm.dd.yy") & ".xls", True
End If
Any help would be greatly appreciated. IT doesn't even seem to do th
check. And it saves anyway. Thank you for your time!
-a clean desk is the work of an idle mind