Using one field to poulate others

D

danny.jurmann

I am sure this is a common question...but I could not find the answer.

I have a form where purchases are recorded (stock table) and it has a
supplier name field, with additional supplier details such as address
below all stored on the (supplier table).

When the supplier name is entered into the form I would like the
address field etc to be automatically populated but I am at a loss how
to do this. Can anyone help?

Many thanks,

Danny
 
G

Guest

Create a comboBox that Include all the fields that you want to display in the
form.
It's better to select from a combo, that way the user can't enter customers
that don't exist.

Select CustName, Address, Phone From TableName

On the after update event of the combo box, you can write the code
Me.Address = Me.ComboBoxName.Column(1)
Me.Phone = Me.ComboBoxName.Column(2)

Or
You can write in the ControlSource of each field
In the Address field
=[ComboBoxName].Column(1)

In the Phone field
=[ComboBoxName].Column(2)

Note: The column number of the list box start with 0 and up
I rather using this method
=========================================

Another method will be, check this link on "Fill Fields automatically on
form based on a control's value"

http://www.mvps.org/access/forms/frm0009.htm
 
D

danny.jurmann

Create a comboBox that Include all the fields that you want to display in the
form.
It's better to select from a combo, that way the user can't enter customers
that don't exist.

Select CustName, Address, Phone From TableName

On the after update event of the combo box, you can write the code
Me.Address = Me.ComboBoxName.Column(1)
Me.Phone = Me.ComboBoxName.Column(2)

Or
You can write in the ControlSource of each field
In the Address field
=[ComboBoxName].Column(1)

In the Phone field
=[ComboBoxName].Column(2)

Note: The column number of the list box start with 0 and up
I rather using this method
=========================================

Another method will be, check this link on "Fill Fields automatically on
form based on a control's value"

http://www.mvps.org/access/forms/frm0009.htm

--
Good Luck
BS"D



I am sure this is a common question...but I could not find the answer.
I have a form where purchases are recorded (stock table) and it has a
supplier name field, with additional supplier details such as address
below all stored on the (supplier table).
When the supplier name is entered into the form I would like the
address field etc to be automatically populated but I am at a loss how
to do this. Can anyone help?
Many thanks,
Danny- Hide quoted text -

- Show quoted text -

You are a gem! Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top