Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLOOKUP and Forms

Status
Not open for further replies.

Scooby62

MIS
Jul 10, 2002
97
CA
Hi there.

I’m trying to update one field on a sub-form once the value of another field on the same sub-form is selected from a combo box. I wrote a macro using the SetValue command.

In the ITEM area of the macro I have:

[Forms]![frmDataEntry-Main]![frmEntry Detail Subform].[Form]![IntName]

In the EXPRESSION area of the macro I have:

DLookUp("[CommonName]","tblBotNames","[BotanicalName]=[Forms]![frmDataEntry-Main]![frmEntry Detail Subform].[Botanical Name]")
 
Perhaps:

[tt]DLookUp("[CommonName]","tblBotNames","[BotanicalName]='" & [Forms]![frmDataEntry-Main]![frmEntry Detail Subform].Form![Botanical Name] & "'")[/tt]
 
Oh thank you. Works perfectly.

Thanks again.

Excellent!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top