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
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

Signature
Good Luck
BS"D
> I am sure this is a common question...but I could not find the answer.
>
[quoted text clipped - 9 lines]
>
> Danny
danny.jurmann@brentpct.nhs.uk - 18 Mar 2007 23:09 GMT
On 15 Mar, 18:29, Ofer Cohen <OferCo...@discussions.microsoft.com>
wrote:
> Create a comboBox that Include all the fields that you want to display in the
> form.
[quoted text clipped - 44 lines]
>
> - Show quoted text -
You are a gem! Thank you