473,803 Members | 3,619 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 5010
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
3323
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) on a form with 30 text boxes, the form's recordsource has been set to a query, both combo boxes and...
2
6605
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
5475
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 registered accounts for a stae program. Each account is registered into the program through a two...
10
2583
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 above. But the combo shows 'Shop Number' as a heading in form view.
11
2809
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 tables only have one field (strPubName and strPubCity), which is their primary key. I also have...
4
6134
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 field is now "One, Two". I have situations where I need to do this with fields that If there is a...
1
6138
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 whose value is "3". I want to look up the ItemDescription of the Item with the Key "3" and show that...
2
3897
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 location to select. Then, upon closing the building management company form, the active/selected record...
1
1529
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', but I do not want the value 'Doctor' to be repeated more than once in the combo box... How can I do...
2
1667
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 selected from the combo box. when i step through the code in debug mode, the combo box nicely...
0
9703
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9566
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10555
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10300
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9127
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7607
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
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

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.