dlookup

  • Thread starter Thread starter ani
  • Start date Start date
A

ani

i have a table which has fields eqno(text field), eq desc(text field),
eqnum(primary key)
on a datasheet subform i want the eqno field values display for all records.

i tried the below dlookups at the text record source which gave me an error.
=DLookUp("[EQPTNO]"," SupportEquipment ","[Text29]=[eqptnum]")
=DLookUp("[EQPTNO]"," [SupportEquipment] ","[Text29]=[eqptnum]")

where text29 is the text field on the subform which stores the eqnum(primary
key)

plese advise what is wrong
 
ani said:
i have a table which has fields eqno(text field), eq desc(text field),
eqnum(primary key)
on a datasheet subform i want the eqno field values display for all records.

i tried the below dlookups at the text record source which gave me an error.
=DLookUp("[EQPTNO]"," SupportEquipment ","[Text29]=[eqptnum]")
=DLookUp("[EQPTNO]"," [SupportEquipment] ","[Text29]=[eqptnum]")

where text29 is the text field on the subform which stores the eqnum(primary
key)

The first parameter tells which field will be returned. Your DLOOKUP will show
EQPTNO
Is that what you want? Also you say the key is eqnum but you're testing a
field called EQPTNO
You need to test the actual key field name

=DLookUp("[EQNO]"," SupportEquipment ","[eqnum]= '" & [Text29] & "'")

To display the description for a given key do this:

=DLookUp("[EQ DESC]"," SupportEquipment ","[eqnum]= '" & [Text29] & "'")

Tom Lake
 
Back
Top