Can a Combo Box send multiple data outputs?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello;

I am using Access 2002 with XP and I am designing a Sales Tax database. I
have a created a form with a Combo Box. The Combo Box has 3 columns: City
Name, City Code, Sales Tax percentage and this data is pulled from a Tax
Table.

I have the Combo Box set so when I choose the appropriate City Name the
corresponding City Code appears in the City Code text box on the form. This
works correctly.

My question - is it possible to send the sales tax percentage in the 3rd
column to a text box called Sales Tax on the form the same as I did with the
City Code data?

To summarize can 2 columns of data from a Combo Box be sent to 2 different
text boxes on the form? I hope my question makes sense>

Thanks for your help!
 
did you try it - using the same method that worked on a single column? if
not, suggest that you try it, and if it does not work, then post back with
an explanation of the method you tried, and what happened (specific error
message, etc).

hth
 
Bill Artman said:
Hello;

I am using Access 2002 with XP and I am designing a Sales Tax database. I
have a created a form with a Combo Box. The Combo Box has 3 columns: City
Name, City Code, Sales Tax percentage and this data is pulled from a Tax
Table.

I have the Combo Box set so when I choose the appropriate City Name the
corresponding City Code appears in the City Code text box on the form.
This
works correctly.

My question - is it possible to send the sales tax percentage in the 3rd
column to a text box called Sales Tax on the form the same as I did with
the
City Code data?

Yes, use the column property of the combo:

Me.txtMyTextBox = Me.cboMyComboBox.Column(n)

where n is the column number (numbers start at 0).

Having said that couldn't you just include your tax table in your form's
query and get the functionality for free?

Keith.
www.keithwilby.com
 
Keith;

Thanks for your reply.

I will try your suggestion but please explain a little more when you tell me
to use the column property of the combo. Please tell me what the column
property is named in the combo box as I am having trouble finding it. What
do you mean by "Me.txtMyTextBox = Me.cboMyComboBox.Column(n)? Am I suppose
to put this into the properties of the text box where I want the combo box to
send the output value? Or am I suppose to enter this into the column
property of the combo box?

You ask if I couldn't include the tax table in the f orm's query and get the
functionality for free? That sounds more efficient - I don't have a form
query I am just pulling the sales tax data.values from a tax table. Could
you please explain what you mean about using the form's query?

Thanks very much for your help!
 
Keith;

When you say to use the column property of the combo box, which property do
you mean - Row Source, Bound Column, etc? What is "Me.txtMyTextBox =
Me.cboMyComboBox.Column(n)"?
 
Bill Artman said:
Keith;

Thanks for your reply.

I will try your suggestion but please explain a little more when you tell
me
to use the column property of the combo. Please tell me what the column
property is named in the combo box as I am having trouble finding it.
What
do you mean by "Me.txtMyTextBox = Me.cboMyComboBox.Column(n)? Am I
suppose
to put this into the properties of the text box where I want the combo box
to
send the output value? Or am I suppose to enter this into the column
property of the combo box?

Substitue "txtMyTextBox" for the name of your text box and "cboMyComboBox"
for the name of your combo box in your code. If the data you require is in
the second column of your combo box then you would use ".Column(1)" in your
code. The code would go in the After Update event of the combo box.
You ask if I couldn't include the tax table in the f orm's query and get
the
functionality for free? That sounds more efficient - I don't have a form
query I am just pulling the sales tax data.values from a tax table. Could
you please explain what you mean about using the form's query?

I haven't seen your design but typically you could include both tables in a
query and use this as your form's data source.

Regards,
Keith.
www.keithwilby.com
 
Keith;

Thanks very much for your repeated replies and for your help. I now
understand what I need to do. Thanks again - have a great week!
 
Bill Artman said:
Keith;

Thanks very much for your repeated replies and for your help. I now
understand what I need to do. Thanks again - have a great week!

You're welcome Bill, glad to help.

Keith.
 
Back
Top