473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Combo box for more than one field

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
2 4997
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
2
by: G.Gerard | last post by:
Hello Does anyone know how to get an entire memo field to be displayed in a combo box drop down list? Example - if the memo field contains the following : This is a test to see if
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
10
by: Bob Darlington | last post by:
I am using the following SQL as a RowSource for a combo box on a form. "SELECT LAN, TenantName as , ShopNum as FROM qTenantSelect " The field 'ShopNum' is a text field and has a caption...
11
by: my-wings | last post by:
I think I've painted myself into a corner, and I'm hoping someone can help me out. I have a table of books (tblBooks), which includes a field (strPubName) for Publisher Name and another field...
4
by: LD | last post by:
Is there a way in Access to store more than one value in a field that has been selected from a combo box? For example, if a combo box had three values that you can select, "One", "Two", and...
1
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items...
2
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg...
1
by: tremonti92 | last post by:
Hello.. I have a table with a field name called 'Professions'. There are many same multiple values for this field, for example, there are many records with the value 'Doctor' under this field. ...
2
by: fredloh | last post by:
i have a table with a yes/no field call "Edited". i have a button that runs code to set the "Edited" field of a selected record to "yes". the code also set the rowsource (using SQL Update and Set...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.