Use dlookup in report with calculated field in form

  • Thread starter Thread starter Basenji
  • Start date Start date
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.
 
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.
 
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?
 
Back
Top