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

VBA Access Report problem "Microsoft can't find field"

Status
Not open for further replies.

Fbobak

Programmer
Mar 24, 2005
13
0
0
US
I am trying to write a report which is based upon a selection from the user. When I run the report I get the message "Microsoft can't find field "" referred to in your expression". The field is contained within the underlying query. Additionally, when I type ME. the field name is shown.
 
This error appears when there is no data in the record source of the table. To prevent the error, you can either check the availabity of data of the report before opening the report (docmd.openreport), or you can use the "NoData" event of the report. I prefer the first one since Access 2000 always gives you an extra warning message if you cancel the OpenReport action. That extra warning may confuse users.

Hope this helps.

Seaport
 
Thanks for the suggestion. I'll try that although I'm not sure if that is the case. I am linked to an AS400 mainframe using ODBC driver interface. There are multiple records. It just seems unusual that I can do the ME.[field name} and it shows but can't find the field when I run the report. Thanks
 
I reran the query and did what you suggested and unfortunately/fortunately there are records. I had the undata event already written into code. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top