Hi hope someone can help,
The code below gives a Run-time error 2448 on the highlighted line?
Private Sub Form_Open(Cancel As Integer)
Dim LastMonthlyReportDate As Date
Dim NewMonthlyReportDate As Date
Dim LastArchiveDate As Date
Forms![frm_HiddenOpen]![txb_NewMonthlyReportDate] = DateSerial(Year(Date), Month(Date) - 1, 1)
LastMonthlyReportDate = Forms![frm_HiddenOpen]![txb_LastMonthlyReportDate]
NewMonthlyReportDate = Forms![frm_HiddenOpen]![txb_NewMonthlyReportDate]
If NewMonthlyReportDate <> LastMonthlyReportDate Then
Forms![frm_HiddenOpen]![txb_LastMonthlyReportDate] = NewMonthlyReportDate
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_SiteMqtArchive_TF"
DoCmd.OpenQuery "qry_SiteMqtArchive_del"
DoCmd.SetWarnings True
Forms![frm_HiddenOpen]![txb_LastArchiveDate] = DateSerial(Year(Date), Month(Date) - 11, 1)
End If
End Sub
The code below gives a Run-time error 2448 on the highlighted line?
Private Sub Form_Open(Cancel As Integer)
Dim LastMonthlyReportDate As Date
Dim NewMonthlyReportDate As Date
Dim LastArchiveDate As Date
Forms![frm_HiddenOpen]![txb_NewMonthlyReportDate] = DateSerial(Year(Date), Month(Date) - 1, 1)
LastMonthlyReportDate = Forms![frm_HiddenOpen]![txb_LastMonthlyReportDate]
NewMonthlyReportDate = Forms![frm_HiddenOpen]![txb_NewMonthlyReportDate]
If NewMonthlyReportDate <> LastMonthlyReportDate Then
Forms![frm_HiddenOpen]![txb_LastMonthlyReportDate] = NewMonthlyReportDate
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry_SiteMqtArchive_TF"
DoCmd.OpenQuery "qry_SiteMqtArchive_del"
DoCmd.SetWarnings True
Forms![frm_HiddenOpen]![txb_LastArchiveDate] = DateSerial(Year(Date), Month(Date) - 11, 1)
End If
End Sub