Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank form

Status
Not open for further replies.

ajorge

MIS
Mar 20, 2002
18
US
I have a form that displays information according to the year that the user enters, the recordsource is a query and ask the user first to input the year. If the year is available the form displays the fields and if the year is not in the records then the form comes up blank. What i want to know is could i display a msgbox when it comes up blank. I've tried if then conditions, but when it comes up blank I get an error saying that there is no value assigned to that field.
 
Hi

You do not explain how you ask for the year number, and how you convey that information to the criteria of your forms recordsource, but..

you could try, in the onopen event of the form:

If Me.Recordcount < 1 Then
msgBox &quot;No Records&quot;
Else
docmd.close
End If
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top