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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto fill a form field based on another inputted form field

Status
Not open for further replies.

sweetp

Technical User
Jan 9, 2002
35
US
Hi - I want three fields to automatically fill in information when another field (combo box) is selected.

Example: User chooses peanut butter from a combo box on the form. Next to that there are three fields labeled: brand1, brand2, brand3. I want the brands to automatically fill in when peanut butter is chosen.

Where do I start? I'm a newbie. Should I be using SQL, or should I be using dlookup or something else??? I'm at a loss here!

Thanks for any help!
 
Hi sweetp,
on a form you have one combo and 2 textbox to display values follow value selected in combo with name: cbo, brand1, brand2
on the afterupdate event of the cbo try this :

Me![brand1]= Me![cbo].Column(1)
Me![brand2]= Me![cbo].Column(2)
 
Guess I'm not doing something right. I inserted the code in the After Event area of the combo box containing peanut butter but the runtime error says it can't find the field "brand1". Why? It is in the same table as the food items (ex. peanut butter).
 
Hi sweetp,
In query for combo you must select 3 column field1,field2, field3 in properties of combo on data section choice Bound Colunm : 1,in format section choice Count Colunm : 3
Brand... at here that the name of field you want to display on
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top