473,416 Members | 1,656 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,416 software developers and data experts.

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 12811
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.column(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***********@ntlworld.com (godber) wrote in message news:<1f**************************@posting.google. 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***********@ntlworld.com (godber) wrote in message news:<1f**************************@posting.google. 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.GoToControl "EmployeeWorks Number" (or whatever is the actual name of
the primary key field. Include quotes)
DoCmd.FindRecord 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.google.c om...
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
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...
1
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...
5
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: ------------------------...
3
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...
2
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...
9
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...
4
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...
5
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...
2
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
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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
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...

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.