Combo box and can it feed two separate control sources

M

Merv R

I have a combo box in a form, it draws it's information from a table with two
fields, description and price. I can bind either one to a field (control
source) in my form, but I wish to bind both fields i.e.description and price
to two feilds on my form so when it puts the description into (lets call it
field one) I want the price to go into a second field (lets call it field
two) simultaneously.

I appologise if some of you have seen this question already I did receive
an e mail telling me I had a reply, on following the link on the mail though
it just came up with a blank page as did the link asking me if i needed to
receive more replies so i am trying again.

Merv R
 
D

Douglas J. Steele

It's not possible to bind to more than one field. However, what you can do
is bind it to one of the two fields (say Description), and add a text box
that's bound to the other field (say Price). In the AfterUpdate event of the
combo box, you can then populate the text box:

Private Sub MyComboBox_AfterUpdate()

Me![Price] = Me.MyComboBox.Column(1)

End Sub

The above assumes that the price is the second column of the combo box (the
Column collection starts numbering at 0)
 
M

Merv R

Many Thanks Doug.

God I'm thick, still took me about three attempts to get it right, that's
how much I know about access, now works beautifully.

Douglas J. Steele said:
It's not possible to bind to more than one field. However, what you can do
is bind it to one of the two fields (say Description), and add a text box
that's bound to the other field (say Price). In the AfterUpdate event of the
combo box, you can then populate the text box:

Private Sub MyComboBox_AfterUpdate()

Me![Price] = Me.MyComboBox.Column(1)

End Sub

The above assumes that the price is the second column of the combo box (the
Column collection starts numbering at 0)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Merv R said:
I have a combo box in a form, it draws it's information from a table with
two
fields, description and price. I can bind either one to a field (control
source) in my form, but I wish to bind both fields i.e.description and
price
to two feilds on my form so when it puts the description into (lets call
it
field one) I want the price to go into a second field (lets call it field
two) simultaneously.

I appologise if some of you have seen this question already I did
receive
an e mail telling me I had a reply, on following the link on the mail
though
it just came up with a blank page as did the link asking me if i needed to
receive more replies so i am trying again.

Merv R
 

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