How to look up in a table depending on an option
I have a tables called Affiliates with the following order
afid,CompanyName,City
I have a form called F1.
I have made the following code which didnt work:
If Forms![F1]![Office] = 1 Then
Forms![F1]![labelOffice].Caption = DLookup(“Affiliates”,”City”, afid = 1)
End if
Can somebody tell me where is my error?