B
Bonnie
Hello everyone! Using A02 on XP. Not a programmer, but learning every day.
I can use the OnNoData event on reports but how do I check for records when
a form opens? I have the following in my button that opens a form (no
subform, just the mainform called fViewOldAdminBill). It doesn't work. I
copied it from a 'no records in table' post. qViewOldAdminBill is the form's
query. I would like to click the button and either get the message 'no
records' or open the form with the records. Am I on the right track? The best
track?
If DCount("*", "qViewOldAdminBill") = 0 Then
MsgBox "There are no Admin Bill records for this contract."
DoCmd.CancelEvent
Exit Sub
Else: 'open the form language
End If
Thanks in advance for any help or advice on this!
I can use the OnNoData event on reports but how do I check for records when
a form opens? I have the following in my button that opens a form (no
subform, just the mainform called fViewOldAdminBill). It doesn't work. I
copied it from a 'no records in table' post. qViewOldAdminBill is the form's
query. I would like to click the button and either get the message 'no
records' or open the form with the records. Am I on the right track? The best
track?
If DCount("*", "qViewOldAdminBill") = 0 Then
MsgBox "There are no Admin Bill records for this contract."
DoCmd.CancelEvent
Exit Sub
Else: 'open the form language
End If
Thanks in advance for any help or advice on this!