Dlookup problems

Everton

Registered User.
Local time
Today, 17:09
Joined
Aug 10, 2000
Messages
34
Hi,

I have a simple, unbound form which has a combo box containing manufacturers, and a text box which I want to display the relevant country when a user selects a manufacturer.

I have tried the following code in the combo box's afterupdate event:

Dim c As String

c = DLookup("[Country]", "Manufacturers", "[Manufacturer] = " & Forms![man-cntry]![man])

Forms![man-cntry]![cntry] = c

When I change the manufacturer, I get a 64479 runtime error which tells me:

"The expression you entered as a query parameter produced this error: 'The object doesn't contain the Automation object '[whatever manufacturer is selected]."

This is driving me nuts, can anybody help?
Thanks,
Paul
 
If [Manufacturer] is a string, try this:

c = DLookup("[Country]", "Manufacturers", "[Manufacturer] = '" & Forms![man-cntry]![man]& "'")
 

Users who are viewing this thread

Back
Top Bottom