davejackson
Technical User
Hi,
I am trying to find the value of my key field based on two fields entered seperately. I have the following code where my table City-Bank contains three fields, Bank, City, BankID.
Result = DLookup("[BankID]", "[City-Bank]", "[Bank] = '" & Bank2 & "' And [City] = " & City2)
I am retrieving Bank2 and City2 from a form but get the error: 'The object doesn't contain the Automation object 'New York'' This is obviously one of my cities on the table. Am I barking up the wrong tree? It seems like it should be easy enough but in VB it is giving me problems.
Thanks in advance,
Dave
I am trying to find the value of my key field based on two fields entered seperately. I have the following code where my table City-Bank contains three fields, Bank, City, BankID.
Result = DLookup("[BankID]", "[City-Bank]", "[Bank] = '" & Bank2 & "' And [City] = " & City2)
I am retrieving Bank2 and City2 from a form but get the error: 'The object doesn't contain the Automation object 'New York'' This is obviously one of my cities on the table. Am I barking up the wrong tree? It seems like it should be easy enough but in VB it is giving me problems.
Thanks in advance,
Dave