cactus1000
Programmer
I had an event procedure that worked fine in Access 97, but doesn't work since converting to access 2002. When records are about to be printed, a message appears if no records are to be found, and a button appears which will take you back to the previous form ("selectrecs"
. Does anyone know why this script no longer works?
Option Compare Database
Option Explicit
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database, rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(Me.RecordSource)
If rst.RecordCount = 0 Then
MsgBox "No records found to print." & Chr(13) & "Click OK to return to 'Select records for printing' menu", 64
DoCmd.OpenForm "selectrecs"
End
End If
End Sub
Option Compare Database
Option Explicit
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database, rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset(Me.RecordSource)
If rst.RecordCount = 0 Then
MsgBox "No records found to print." & Chr(13) & "Click OK to return to 'Select records for printing' menu", 64
DoCmd.OpenForm "selectrecs"
End
End If
End Sub