Cascade combo boxes into text box value

G

Guest

I have three boxes on a form that I want populated.
The table looks like this:
Origin Customer Customer ID
100 A 123
100 B 456
100 C 789
200 A 123
200 B 456
300 B 456
400 D 999

Combo Box 1: Origin
Combo Box 2: Customer
Text Box 1: Customer ID

In the first combo box (Origin), the user selects the origin location.
The second combo box (Customer), the user may only select the Customers
valid for this origin.
I have the cascading working great for this.
All I want to do is fill Text Box with the appropriate Customer ID.
I realize this is slightly redundant, but having this box populated makes my
queries later on a lot simpler.
Anyhow, I have tried pulling directly from the table, I have tried creating
a query to pull from, but somehow, I am not able to get the customer ID to
fill this text box.
The closest I came was to have the customer ID in the combo box #2 and bind
this field. This worked for display purposes only, but when I tried using the
data to append to other tables, it was bound to the id and the name was then
not available.

I am sure this is extremely easy to an advanced used, so hopefully someone
can point me in the right direction.
Thanks!!
 
T

tina

an advanced user isn't likely to violate normalization rules without a sound
business reason for doing so (wanting to avoid linking tables in queries
does not qualify). presumably you have a Customers table; the only value
from a record in that table that should be saved into a related "child"
record in another table is the primary key value. if you insist on saving
other Customer data in another table redundantly, you're jeopardizing the
consistency, and therefore the accuracy and validity, of your data; but, in
a form you can use VBA code, or a SetValue action in a macro, to pull data
from a column in a combo box and add it to a bound textbox control.

hth
 

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