Use dlookup in report with calculated field in form

B

Basenji

In a form in Access 2003 I have a control, RoomGrade, calculating a
percentage that corresponds with an inspection number, InspectionID. This
percentage needs to show in the report with the corresponding InspectionID.
So a text box for the data source with the following was added in the report
with this formula
=DLookUp("Forms!frmInspection1!RoomGrade","tblInspection","InspectionId =" &
Forms!frmInspection1!InspectionId). I have reviewed the MSDN examples and
Allen Browne's info and tried changing the syntax but keep coming up with a
name or error message. Any suggestions would be appreciated. Thank you.
 
P

Pendragon

As you have written it, "forms!frmInspection1!RoomGrade" would have to be the
actual name of the field in tblInspection. I'm guessing that you want
"RoomGrade" instead; basically, give me the RoomGrade from tblInspection
where the InspectionID in tblInpsection equals InspectionID from my form.
 
B

Basenji

Yes, I want "RoomGrade". "RoomGrade" is a calculated control in the form
which shows a percentage based upon fields in the table. Is it possible to
use dlookup in a control in the report to lookup the value in the control in
the form so that the number prints in the report? If so, what is the syntax?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top