Hello Gurus,
I have been tasked with correcting issues with our upgrade(Access9 7/2000 to Access2007) and essentially know very little about Access (any version) or Visual Basic. Here is my current issue: when we open one of our .accdb it throws this error:
"Compile error: Method or data not found"
CODE:
Private Sub Form_Load()
'20010105 JBT
Dim RS As Recordset
Dim SQL As String
DoCmd.Maximize
' *** AUTO STATUS REPORT GENERATOR
Set RS = CurrentDb.OpenR ecordset("tblMo nthlyTrackings" , dbOpenSnapshot)
RS.FindFirst "(([Printed] = 0) AND (Month([CallDt]) = Month(Date())-1))"
If Not RS.NoMatch Then
If MsgBox("You have Monthly Status records for last month. Do you wish a report printed?", vbYesNo, "UNPRINTED RECORDS FOUND") = vbYes Then
RS.Close
DoCmd.OpenRepor t "rptMonthlyStat usReport", acViewPreview
SQL = "UPDATE tblMonthlyTrack ings SET tblMonthlyTrack ings.Printed = -1 " & _
"WHERE (((tblMonthlyTr ackings.Printed )=0));"
CurrentDb.Execu te SQL
End If
End If
CurrentDb.Close
' *** end AUTO STATUS REPORT GENERATOR
End Sub
(see attached jpeg)
Can anyone pass on some pointers of how to fix this? A good tutorial would be nice, I'm learning Access 2007 & VB by troubleshooting these errors, so it's peice by peice.
THANK YOU in advance for your assistance!!
I have been tasked with correcting issues with our upgrade(Access9 7/2000 to Access2007) and essentially know very little about Access (any version) or Visual Basic. Here is my current issue: when we open one of our .accdb it throws this error:
"Compile error: Method or data not found"
CODE:
Private Sub Form_Load()
'20010105 JBT
Dim RS As Recordset
Dim SQL As String
DoCmd.Maximize
' *** AUTO STATUS REPORT GENERATOR
Set RS = CurrentDb.OpenR ecordset("tblMo nthlyTrackings" , dbOpenSnapshot)
RS.FindFirst "(([Printed] = 0) AND (Month([CallDt]) = Month(Date())-1))"
If Not RS.NoMatch Then
If MsgBox("You have Monthly Status records for last month. Do you wish a report printed?", vbYesNo, "UNPRINTED RECORDS FOUND") = vbYes Then
RS.Close
DoCmd.OpenRepor t "rptMonthlyStat usReport", acViewPreview
SQL = "UPDATE tblMonthlyTrack ings SET tblMonthlyTrack ings.Printed = -1 " & _
"WHERE (((tblMonthlyTr ackings.Printed )=0));"
CurrentDb.Execu te SQL
End If
End If
CurrentDb.Close
' *** end AUTO STATUS REPORT GENERATOR
End Sub
(see attached jpeg)
Can anyone pass on some pointers of how to fix this? A good tutorial would be nice, I'm learning Access 2007 & VB by troubleshooting these errors, so it's peice by peice.
THANK YOU in advance for your assistance!!
Comment