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!

Form Open Run-Time Error 2427 1

Status
Not open for further replies.

sebell

Programmer
Oct 16, 2002
51
US
I have a form reading from a query. If there is no data in the query I get a run-time error 2427 - 'You entered an expression that has no value.'
Is there any way to check for data before opening up the form and if there is none bring up a msgbox?

Thank you in advance for your help,
Sherry
 
Try something like this in the form's OnOpen event:

if me.recordset.recordcount = 0 then
msgbox "No records, cancelling",vbokonly
cancel = true
end if

-Gary
 
Gary,
That worked great!! :)
Thank you,
Sherry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top