dlookup missing criteria?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following dlookup on my main form(frmProject), looking up values
based of a combox(combo883) in a continuous
subform(frm_Project_detail_subform). DLookup works fine for the first record
of cmb883, however, if there are multiple records in the subform and I click
on those the value for the first record remains in combo883. When I click on
other records, I want the location displayed for those as well. What am I
missing? Thanks!

=DLookUp("[EQP_LOCATION]","tbl_EQUIPMENT","
[FORMS]![frmProject]![frm_Project_detail_subform]![Combo883] =
[tbl_EQUIPMENT]![equipment_name] ")
 
Your DLookup can't be working at all; the syntax is incorrect in two ways!
First, in the Where clause, a field out of the table must come first, you
have a field off your subform. Second, the Combo883 expression must be
surrounded by single quotes because it is text. Change to the following:
=DLookUp("[EQP_LOCATION]","tbl_EQUIPMENT","
[tbl_EQUIPMENT]![equipment_name] = '" &
[FORMS]![frmProject]![frm_Project_detail_subform]![Combo883] & "'")
 
Thanks! This works. Newbie here... :) I appreciate the help.

PC Datasheet said:
Your DLookup can't be working at all; the syntax is incorrect in two ways!
First, in the Where clause, a field out of the table must come first, you
have a field off your subform. Second, the Combo883 expression must be
surrounded by single quotes because it is text. Change to the following:
=DLookUp("[EQP_LOCATION]","tbl_EQUIPMENT","
[tbl_EQUIPMENT]![equipment_name] = '" &
[FORMS]![frmProject]![frm_Project_detail_subform]![Combo883] & "'")

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com




Dave said:
I have the following dlookup on my main form(frmProject), looking up values
based of a combox(combo883) in a continuous
subform(frm_Project_detail_subform). DLookup works fine for the first record
of cmb883, however, if there are multiple records in the subform and I click
on those the value for the first record remains in combo883. When I click on
other records, I want the location displayed for those as well. What am I
missing? Thanks!

=DLookUp("[EQP_LOCATION]","tbl_EQUIPMENT","
[FORMS]![frmProject]![frm_Project_detail_subform]![Combo883] =
[tbl_EQUIPMENT]![equipment_name] ")
 
Back
Top