473,748 Members | 8,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate text boxes with combo box selection

I need to populate text boxes for instance with employee information
using their unique employee works number selected from a combo box.
Can anyone help, I am told thru visual basic this can be achieved.
Nov 13 '05 #1
4 12847
gj
godber wrote:
I need to populate text boxes for instance with employee information
using their unique employee works number selected from a combo box.
Can anyone help, I am told thru visual basic this can be achieved.

You can do it without VBA.

Add extra columns to the combo box
Set the width of the columns to 0 if you want to hide them
In the text bnoxes you want to show the related employee data just refer
to the column:
cmb_empid.colum n(2)

Even if the combo box hides the extra coilumns you can refer to them
from another control.
ANother way to do this is to have a subform for the employee data and
link the Parent/Child based on the Employee ID selected in the COmbo
box. This option may be better if the information may be required to be
updated on this form.

Have fun
GJ
Nov 13 '05 #2
mi***********@n tlworld.com (godber) wrote in message news:<1f******* *************** ****@posting.go ogle.com>...
I need to populate text boxes for instance with employee information
using their unique employee works number selected from a combo box.
Can anyone help, I am told thru visual basic this can be achieved.


Umm... this is vague. Yes, you can. There are lots of ways.
1. using DLookup (yech!)
2. Using recordsets
3. having multiple columns in your combobox and referencing those
4. ... (insert your own here)
Nov 13 '05 #3
In the properties part of your combobox create a recordsource - which
is usually a set query.

The order of columns of your query is the same as your combobox.

Put all the info into your query for the combobox that you want to
display in the text boxes.

Create the text boxes. Set the control source of your text boxes to
the corresponding column in your combobox - ie TYPE THIS: =
me.comboboxname .column(3)

Remember the first column is 0, not 1.

When you select an item in the combo its column data will then appear
in the text box.

Remember you can hide the columns you do not want to display by
chnaging the column width.

Lincoln
Sydney Australia


mi***********@n tlworld.com (godber) wrote in message news:<1f******* *************** ****@posting.go ogle.com>...
I need to populate text boxes for instance with employee information
using their unique employee works number selected from a combo box.
Can anyone help, I am told thru visual basic this can be achieved.

Nov 13 '05 #4
Create a form with all of the desired data fields including the employee's
primary key. Now create an unbound combo box for employee selection. Make
sure that the combo box's underlying query includes the Primary Key for the
'employee works number' plus whatever other fields are needed to correctly
identify the particular employee to be selected, such as LastName,
FirstName. Name the combo box "EmployeeSelect ". Enter the following code in
the AfterUpdate event for the combo box:

DoCmd.GoToContr ol "EmployeeWo rks Number" (or whatever is the actual name of
the primary key field. Include quotes)
DoCmd.FindRecor d Me![EmployeeSelect]

That's all. When the employee is selected from the combo box the form will
populate with whatever fields are in the employee's record having that
primary key.

Con Giacomini

"godber" <mi***********@ ntlworld.com> wrote in message
news:1f******** *************** ***@posting.goo gle.com...
I need to populate text boxes for instance with employee information
using their unique employee works number selected from a combo box.
Can anyone help, I am told thru visual basic this can be achieved.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2155
by: Serious_Practitioner | last post by:
This is such a simple problem. I've asked for, and gotten, help with this in the past, and I can't make this work. Once more, please - I want to be able to put a member number (which is the primary key of a table called tblMemberInfo) into a text box on an unbound form and get back, in some other text boxes, other information (name, e-mail address and date of birth, say) from the same table. I also want to get, from a table called...
1
2038
by: Cindi | last post by:
Hi, Another newbie with a question that I hope someone can point me in the right direction. The goal is to populate a text box with data according to the selection in a combo box while still being able to navigate the records one by one. The combo box record source is a table/query asking for the ID, Subj, Title, CourseGoals from one table and displays Column 1. I've set up the text box
5
2249
by: Ant | last post by:
Hi, (Winform VS2003) I have a combo box bound to a typed data set. When the form loads, the combo box is popluated using a method containing the simple code below: ------------------------ // Fill the datasets for the combo boxes daDepartment.Fill(dsDepartment.Departments);
3
7874
by: joseph.mccastlain | last post by:
Hello All, I am a new user to Access. I am currently designing a database consisting of four tables for multiple users. Rather than bore you with the goals and such, here is what I am attempting to do: I have two combo boxes, the first of which contains three text values (Org 1, Org 2, Org 3) and the second combo box contains a listing of 30 or so clients. I would like to condense the second combo box based upon the selection of the...
2
1898
by: ebasshead | last post by:
Hi everyone, I'm having trouble getting my head around how to make a text box appear from a combo box selection. The combo box lists methods of payment eg cash, visa, mastercard. If visa or mastercard is selected I would love some text boxes to appear for credit card details. I did it with check boxes but cant make it go for combo boxes. Thanks for any help. Eddie
9
4998
by: Marianne160 | last post by:
Hi, I know there are various answers to this problem available on the web but none of them seem to work for me. I am using Access 2003 to make a form to look up data from a table. I have so far created three combo boxes that cascade down from Name to Project to Date and when this has been chosen I have four textbox fields I want to display based on this selection. I tried linking the last combo box comboDate to update these fields after...
4
13970
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt tbl_Input has three fields: OSE_Job, OSE_Name, OSE_Wt I have populated tbl_OSE_Info table. I need to create a form that will store the data in tbl_Input I have racked my brain so much trying to figure out how to auto populate a field based on a...
5
4007
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make Fields Names: countrycode, make
2
3324
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
0
8991
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
9548
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
9325
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
9249
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8244
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
6796
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
6076
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
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
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.