Form Based off Query Question

S

scott04

Hi everyone,
I have a form that's data source is based off a query. My question deal
with when the agent clears out their que and clicks on the form when zero
records are present. When this happens only the form header loads since
there are not any records left. Is there a way i can have a message popup on
the form load advising them that there are zero records needed to view??? I
know that it means zero records but i do not want to have to train them if a
message box can do the trick. Any suggestions? Thanks
 
S

scott04

Figured it out:
Private Sub Form_Load()
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "There are currently no records to view.", vbInformation, "No
Records"
DoCmd.Close acForm, Me.Name, acSaveNo
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top