Dookup in a report

  • Thread starter Thread starter szag via AccessMonster.com
  • Start date Start date
S

szag via AccessMonster.com

I am trying ot use a Dlookup command in a report to pull a value from a
subform that is open.

I want to get the "Sales#" value from a subform "F_UniqueSales#, where the
"Auto#" (in the subform) is equal to the Match# in the report. I can't get
the DLookup command to work - just keep getting an error returned. Can
anybody help
 
You can't use DlookUp on a sub form, the dlookup is used to look for a value
in the table, so use the table that the sub form is bounded to in the dlookup
expression

=DlookUp("[Sales#]","[TableName]","[Auto#] =" & [Match#])

To refer to a field in the sub form, while it's open
=Forms![MainFormName]![SubFormName].Form![FieldName]

But it doesn't filter the record
 
Back
Top