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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Detail section blank if no records returned 1

Status
Not open for further replies.

votegop

Technical User
Feb 22, 2002
127
US
I have a couple of forms that for some reason are now returning blank "detail" sections if no records are returned from the source (a query).

I don't mean the records are blank, I mean the entire detail section is not there! No fields, labels, or anything. Any ideas?

Thanks.
Jay
 
If the recordsource results in no records, and your form has the Allow Additions property set to No, then you will see a blank form.

You can get around this by testing for no records before opening the form.

For example, on the command button that opens the form you could do a DCount of a filed in the form's recordsource and if none exist:

If DCount("[SomeField]","SomeRecordSource") = 0 then
MsgBox "No records were found for the selected criteria.",vbOKOnly, "No Records Found!"
Exit Sub
End If

Hope this helps! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Sorry for the delay in responding. Thanks for the help...you were exactly right!

Jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top