Hi, all!
I have a form set up to display only certain records in a table, using a filter, to wit:
Now, I'd like to have an escape clause to display a MsgBox and not open the form if the filter results in NO records to display. I tried this, and it ain't right, but I don't know what to test for instead:
Any help greatly appreciated.... You all have been very helpful since I found you a few weeks ago!
ATAIntern(-:
I have a form set up to display only certain records in a table, using a filter, to wit:
Code:
Me.Filter = "DeptCode = '" & Forms!SelectProject!cboDept & "' AND StatusID = 'A'"
Me.FilterOn = True
Now, I'd like to have an escape clause to display a MsgBox and not open the form if the filter results in NO records to display. I tried this, and it ain't right, but I don't know what to test for instead:
Code:
If IsNull(Me.CurrentRecord) Then
MsgBox "There are no active projects for this department.", vbExclamation, "No Active Projects"
DoCmd.Close
End If
Any help greatly appreciated.... You all have been very helpful since I found you a few weeks ago!
ATAIntern(-: