Update table and text box after a combo box selection is made

S

sandisz66

I'd like to have a text box display certain information when a particular
selection is made in a combo box as well as the table. For example – I have
6 options in a combo box. Depending on which option is chosen there are 6
different corresponding pieces of information that I would like displayed in
a text box and all data collected in a table for future reporting purposes.
Can anyone please help?

Thank you!
 
K

Klatuu

Half of your question is easy. The other half is unclear and needs further
description.

As to inserting a value in a text box based on what is chosen in a combo
box, you use the combo box's After Update event to populate the text box.
That is the easy part. The other part is that you don't say if the value in
the text box should be what the user sees in the combo, how many columns in
the combo, etc.

If you could provide a bit more detail, it would be helpful. Please provide
the information in two sections. First, describe exactly what you wan to do
to populate the text box. Then, separately describe what you want to do with
the table.
 
S

sandisz66

Hi Klatuu,

I have a combo box with one column of 6 different values(lets say 6
different weights). I would like the text box to show one of the 6 different
costs incurred; based off the weight that the user chooses in the combo box.
so basically if you choose weight A in the combo box i would like to have the
text box update with cost A. if weight B is chosen, then the text box would
display cost B. in addition, I would like to have both of those values to be
captured in table1 (which holds all the data from the form) in the record
that has all the other patient information I had setup an update event but
it isn't working.

thanks so much for your help!
Sandi
 
K

Klatuu

All you need to do is bind the field in your table that carries the weight to
the text box. That will cause the value to be saved in the table. To put
the value from the combo into the text box, use the After Update event of the
combo:

Me.MyTextBox = Me.MyComboBox
 

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