473,581 Members | 2,755 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5003
You can refer to the individual columns in the selected row of the combobox
as Me.MyCombo.Colu mn(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_AfterUp date

Me.MyOtherTextB ox = Me.MyCombo.Colu mn(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***@LUVSPAMs andmansoftware. 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******@canad a.com> wrote in
news:EG******** ***********@new s02.bloor.is.ne t.cable.rogers. com:
You can refer to the individual columns in the selected row of the
combobox as Me.MyCombo.Colu mn(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_AfterUp date

Me.MyOtherTextB ox = Me.MyCombo.Colu mn(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
3312
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 about 3 years and I'm more rusty than I thought I was. Anyway, in a nutshell: The scenario: 2 combo boxes (comboLastName and comboStateorProvince)...
2
6592
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
5438
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 like to eventually be able to filter down through the tables untill i can reach one unique record. I am creating a datbase to keep track of...
10
2565
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 property set to 'Shop Number' in the table design. In the combo box though, I want to use 'Shop' as the heading (to save width) as shown in the SQL...
11
2789
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 (strPubCity) for Publisher City. These two fields have a many-to-one relationship with tables, (tlkpPubName and tlkpPubCity) respectively. The lookup...
4
6107
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 "Three". How do you drop down the list and select a first value ("One") then do the same and select a second value ("Two") so that the value in the...
1
6099
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 Table. I would use the key to the Items Table from the selection the user made in the combo box. SO: User chooses an item from the combo box...
2
3887
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 mgmt company names and then to open a building management company form to show all records with this name, so the user can find the correct branch...
1
1525
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. Here are the values under this field in the table: I want to make a form with a combo box where the combo box shows values under 'Professions',...
2
1651
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 statement) of a combo box to display only records with the "Edited" field = "No". the button and the combo box are on the same form. the record is...
0
7876
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7804
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6563
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5681
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1409
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.