No Records "Message"

chuckster

Registered User.
Local time
Today, 16:48
Joined
Oct 4, 2000
Messages
52
I have a "Continous Form" which displays data from a query. The form does not allow additions or deletes.

Sometimes there is no data to display and the form comes up blank which is fine but I would like to print a message on the screen either a messagebox or an unbound texttbox saying "No Messages. Lucky".

I cannot however trigger an event to do this. I cannot refer to any of the fields on the form as none appear. I have tried referring to certian fields isnull() or >0 etc but nothing happens as there is no field to compare it to.

Is there a way to say "qryMessages" if no records to display then messagebox?

Any Ideas?
 
Form Open
If Me.RecordsetClone.RecordsetCount=0 Then
MsgBox "Etc"
DoCmd.Close
EndIf
 
You could also place a label on the form with Name lblNoData and Caption "No Messages. Lucky!". In the Form's OnOpen event write

Me.lblNoData.Visible = (DCount("AnyField","qryMessages") = 0)

[This message has been edited by jimbrooking (edited 07-14-2001).]
 
Thanks M8. I didn't have any luck with Rich's suggestion. It said that the method was unsupported? Probably my fault.

Thanks Jim your suggestion worked splendidly.

Chuckster
 

Users who are viewing this thread

Back
Top Bottom