Populate text box based on another text box entry

  • Thread starter AimeeK via AccessMonster.com
  • Start date
A

AimeeK via AccessMonster.com

Hello, I'm trying to set up a form in which if a user types a product code
into one text box, in the next text box the product's description is returned.

Here are the fields and controls involved.

[EXCEPT PROD CODE1]...control name is Text260 (I'm very new at developing
these things, so I never got around to renaming the controls)...this is where
the user would enter a product code

[EXCEPT PROD DESC1]...control name is Text227...this is where the description
would automatically be filled in based on the product code entered in the
previous text box

I'm thinking DLookup might be the answer, but I'm having trouble grasping
this. I do have a table listing the product codes and descriptions, which is
named Z006. I need to know in which controls to put the code, which events
in the control should have the code, as well as the syntax.

Any help is most appreciated...thanks!
 
J

Jeff Boyce

Aimee

What you've described is what a combo box control can easily do.

Instead of asking your user to know/remember product codes, create a list of
the products (a table is a good place for this, as you may be adding new
products!). Now create a query that returns these product names.

On your form, add a combo box that uses the query as a source.

This way, your users get to pick something that means something to them
(product names, rather than codes). And you don't have to come up with code
to stick the product name into a second text box!

Regards

Jeff Boyce
<Office/Access MVP>
 

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