If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Auto fill table based on another field

I have a table titled Koper. There are two fields in it called: Buyer and Address. I have another table titled Main to which the records are saved to. The two fields in question are; Buyer and Address. I have a form titled FrmMain with two comboboxes for the Buyer (cmbBuy) and Address (cmbAddress).

When I choose the correct Buyer on the form I want the Address field to be filled automatically.

After research on the i/net I found and adjusted the following code to be entered in the AfterUpdate of cmbBuy. It does not word and the debugger tell met the syntax is wrong - I can't locate the problem;

Auto fill table based on another field

Sorry to be such a pain in the neck, but seems that I cannot get it to work.
I entered the following code;
cmbAddress.Text = DLookup("[Address]", "[Koper]", "[Koper].[Buyer] = ' " & Me!cmbBuy & " ' ")
Now I get a message "Microsoft Access can't find the filed 'cmbBuy' in your expression - Runtime Error 2465