I have code like
Option Compare Database
Option
Explicit
Private Sub
TotalReport_Click()
DoCmd.SetWarnings False
DoCmd.OutputTo acOutputQuery, "Months", "ExcelWorkbook(*.xlsx)", "D:\Files\Database\Excel\Monthstime.xlsx", False, "", , acExportQualityPrint
DoCmd.OutputTo acOutputQuery, "Quarters", "ExcelWorkbook(*.xlsx)", "D:\Files\Database\Excel\Quarterstime.xlsx", False, "", , acExportQualityPrint
MsgBox "Success!!", vbInformation, ""
DoCmd.SetWarnings True
FollowHyperlink "D:\Personal\NewFolder\PPT\TotalPresentation.p ptx"
Like the code continues..................
The function of the code is to open an PPT by linking to excel files. It woked perfect until last month. Don't know what happened few days back but when we click on the button it returning an error as ""Datatype error in criterion selection". When I debug the code I found that there is an error in the redmark code. When I went into the file path I came to know that the "Quarterstime" file is deleted.
from the backup folder I copied the "Quarterstime" file and pasted it in the specified location ."D:\Files\Database\Excel\"
When I click the button to run the code it again returning the same error as datatype error in criterion selection and error at the same line (quarterstime). When I look into the folder the file automatically got deleted (I tried it for 3 times and found that the quartersfile is going to be deleted automatically due to datatype error)
I just don't know why is this happening. What would be the reasons for it and how can i solve this issue and to move on a right track.