Help! multipal record report

J

Jason Frazer

I have a report that works great if i report 1 record at a time. If I
report more than 1 record at a time my fields that i used the dlookup
command do not change. They keep the value from the record currently
selected on my form. All the
other fields work great. How can i fix this problem? All the printing is
handles though event procedures on buttons.

Here is my control source expression in the report.

=DLookUp("[Field2]","[31 Design Load]","[Field1] = Forms![Bridge Inspection
Form]![Design Load (31)]")


Here is the code for printing the currect record the the loaded form [Bridge
Inspection Form]

Private Sub Command243_Click()
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
stDocName = "Structure Inventory and Appraisal Sheet"
DoCmd.OpenReport "Structure Inventory and Appraisal Sheet", acPreview, ,
"[Structure Number (8)] = Forms![Bridge Inspection Form].form![Structure
Number (8)]"
End Sub

Here is the code for printing all the records in form [Bridge Inspection
Form]

Private Sub Command244_Click()
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String
stDocName = "Structure Inventory and Appraisal Sheet"
DoCmd.OpenReport "Structure Inventory and Appraisal Sheet", acPreview
End Sub

Thanks for any help you can provide
Jason
 
D

Duane Hookom

[Field1] and [Field2]? What's up with that? You will probably need to set
your where clause in the DLookup() to reference some value in the same
section of the report.

BTW: do yourself (and others) a favor by using informative object names.
Tony Toews has a great resource for naming at
http://www.granite.ab.ca/access/tablefieldnaming.htm.
 

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