I've got an issue with date formatting that I cannot resolve.
i have the following codes:
The tables/records its referring to are also formatted MMDDYYYY. however, when i attempt to run it, i get the error messagE:
"Run-time error '3421':
Data type conversion error.
Any thoughts on why this would be the case if everything appears to be in the same format?
Thanks in advance,
Guy
i have the following codes:
Code:
Dim CurrentDate As String
Dim rstDaily_Date As Object
Dim rstFile_Date As Object
Dim dbDatabase As Object
CurrentDate = Date
CurrentDate = Format(CurrentDate, "MMDDYYYY")
Set dbDatabase = CurrentDb
Set rstFile_Date = dbDatabase.OpenRecordset("File Date")
Set rstDaily_Date = dbDatabase.OpenRecordset("Date of Data")
'Change Date of Data for Daily files to proper value
rstDaily_Date.Edit
rstDaily_Date("Date of Data").Value = rstFile_Date("LastRunDate")
rstDaily_Date.Update
'Change date to Current Date
rstFile_Date.Edit
rstFile_Date("LastRunDate").Value = CurrentDate
rstFile_Date.Update
"Run-time error '3421':
Data type conversion error.
Any thoughts on why this would be the case if everything appears to be in the same format?
Thanks in advance,
Guy