I have 2 tables called Contacts and Meeting Details, both with fields called Contact_Name and Service_Area. They are joined by Contact_Name. I have created a form based on the Meeting Details table. It uses a Combo box to look up the Customer name. I want it to then auto-populate the Service_area field from the Contacts table.
The combo box has Control Source: Contact_Name and Row Source: Contact. I have placed the following code in the combo box 'after update' event:
Private Sub Contact_Name_AfterUpdate()
=DLookUp("Service_Area","Contacts","Contact_Name =" & Contact_Name)
End Sub
This generates a compile error "Expected: Line number or label or statement or end of statement"
I have tried several variations of this but can't get it to work. If possible I would also like for users to be able to then overtype the Service area if it has since changed, and for this to be written back to the Contacts table. (jam on it eh!). I should say i'm fairly new to Access.
The combo box has Control Source: Contact_Name and Row Source: Contact. I have placed the following code in the combo box 'after update' event:
Private Sub Contact_Name_AfterUpdate()
=DLookUp("Service_Area","Contacts","Contact_Name =" & Contact_Name)
End Sub
This generates a compile error "Expected: Line number or label or statement or end of statement"
I have tried several variations of this but can't get it to work. If possible I would also like for users to be able to then overtype the Service area if it has since changed, and for this to be written back to the Contacts table. (jam on it eh!). I should say i'm fairly new to Access.