By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

Combo box for more than one field

P: n/a
I have a table (tblParts) containing Description and PartNumber fields.
I have an input form for another table containing the same fields.

I am using tblParts as the row source for a combo box on the input form for
the second table.

I would like to be able to select an item from the Description field of the
combo box and have it update both fields in the input form.

Any help will be greatly appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can refer to the individual columns in the selected row of the combobox
as Me.MyCombo.Column(n), where n is 0 to 1 less than the number of columns
in the combobox MyCombo.

So if you've bound the first column (column 0) to one field in your form, in
the AfterUpdate event of the combo, you can put code like:

Private Sub MyCombo_AfterUpdate

Me.MyOtherTextBox = Me.MyCombo.Column(1)

End Sub

to populate a textbox named MyOtherTextBox with the value of the second
column.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
"Bob Sanderson" <xn***@LUVSPAMsandmansoftware.com> wrote in message
news:Xn**********************************@167.206. 3.2...
I have a table (tblParts) containing Description and PartNumber fields.
I have an input form for another table containing the same fields.

I am using tblParts as the row source for a combo box on the input form for the second table.

I would like to be able to select an item from the Description field of the combo box and have it update both fields in the input form.

Any help will be greatly appreciated.

Nov 12 '05 #2

P: n/a
"Douglas J. Steele" <dj******@canada.com> wrote in
news:EG*******************@news02.bloor.is.net.cab le.rogers.com:
You can refer to the individual columns in the selected row of the
combobox as Me.MyCombo.Column(n), where n is 0 to 1 less than the
number of columns in the combobox MyCombo.

So if you've bound the first column (column 0) to one field in your
form, in the AfterUpdate event of the combo, you can put code like:

Private Sub MyCombo_AfterUpdate

Me.MyOtherTextBox = Me.MyCombo.Column(1)

End Sub

to populate a textbox named MyOtherTextBox with the value of the
second column.


That did it, thanks.
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.