Autopopulate field dependent.

A

Andre G

I have a table with 3 columns in it, Product, Company,
Code. In my form, I want to be able to select the Product
from a drop down list, and then have the corresponding
Company and Code information automatically filled into
their own separate fields (i.e. text boxes or whatever
will work).

I've tried a few different approaches, but I think I'm
overthinking this one, it just seems so simple to do.
 
J

JeffAb

One of the things I will usually do in this situation is
in the 'Update' event of the combo box, I will write code
that gets the information needed to fill the text boxes.
You can use a DLookup() to get these filled. If you are
filling something with more than one possible answer (i.e.
a list box of several things for the one selected) you
will want to use an ADO/DAO connection and write a SQL
statement to select the information and use that to fill
the record source of the list box.
 
A

Andre Grujovski

Okay, I'm still a little confused. How does using the
DLookup() function in the combo box populate the text
boxes. The information needs to get "sent" to the text
boxes, but there is no way to tell them what to get.

I guess I don't see the heirarchy of data flow.
 
A

Andre G

Wow, figured it out. Thanks for the replies, turns out I
was concatenating a string and there was an extra space in
the "word". DLookup() worked great.
 

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