Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoFill Other Fields From Data

Status
Not open for further replies.

asafblasberg

Programmer
Jun 22, 2004
21
US
Hello, I have a pulldown which is linked to a table. Then I have other fields. How do you do it so that after you select something from the pulldown it automatically populate the other fields in the form by looking at the table.

I.e. you have a product which has a description.

If you choose Apple from the pulldown, it should immediately populate a field in the form called "Description" - The descirption should say for example "great tasting."

Must be done i guess with recordset anyone know?
Asaf
THanks!
 
If you want to have a control on your form show a different field in your pull-down besides the bound field, then set the form ControlSource to: =[MyPullDown].Column(1)

The actual column number depends on the field position in your pull-down. Usually it starts at zero and increments by one.

Mike Dorthick
 
Have you tried using DLookup code. I think that that is what you are chasing.

Here is a sample that I have used in a db
Me.Contact = DLookup("ContactName", "[tblCustomers]", "CustomerID =" & Me.CustomerID)

ContactName being the name of the field in the table that holds the information you are wanting in the field.

tblCustomers obviously being the table name holding the data

The rest is the criteria for the contactname ie that the customerId must equal the customerid on the form.

Hope that is what you are looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top