Update two fields from combo box

gandalfus

New member
Local time
Today, 10:33
Joined
Sep 21, 2012
Messages
5
I am new to access, I have just created my first database and I am having a problem with the use of a combo box. I have created a sample form and attached it to this post to show what I am trying to do.
In the sample I have created a main data file with a main form for data entry, I have also created two other data files named "Clients (containng 2 fields)" and "Reviewers" (containing 2 fields) both of these files contain lookup information for the main data file.
The main form I have created has a primary key autonumber field as the "record number" field, there are four other fields. these are;
- Client Name (as a combo box) - with drop down lookup showing both of the fields in "Clients"
- Client Address as a normal field.
- Reviewer Name (as a combo box) - with drop down lookup showing both of the fields in "Reviewers"
- Reviewer Address as a normal field.
what I would like to happen if possible is; when I choose the client name from the drop down list, an automatic update of the "Client Name" field and the "Client Address" field is to occur.
I have been on the forum looking for a long time and cannot seem to find information on how to do this.
Any help would br greatly appreciated. Thanks in advance.
 

Attachments

Welcome to the Forum,

You need to look at the Events behind the combo and in this case After Update and then add some code as below: Find attached copy of your database with this working.

Code:
Private Sub ClientName_AfterUpdate()
Me.ClientAddress = Me.ClientName.Column(1)

End Sub

Private Sub ReviewerName_AfterUpdate()
Me.ReviewerAddress = Me.ReviewerName.Column(1)

End Sub
 

Attachments

Users who are viewing this thread

Back
Top Bottom