Auto fill

M

MAANI

I'm starting to learn microsoft access,and I build my first database,I have a
table of employee name,badge numberand team,and I did a combobox for badge
numbers,my question is,how could I make an auto fill the name and the team
when I choose the badge number?
 
A

Al Campagna

MAANI,
Since you're capturing the BadgeNo, you only need to 'display" the
EmpName and Team. When you have the BadgeNo, you can always relate it abck
to the EmpName and Team... in any form,query, or report.
If you ever "re-issue" a previously used BadgeNo, then that will require
a different solution.
I'll assume not...

Bind the combobox (ex. name cboBadgeNo) to your BadgeNo field.
In the combo, set up three columns.
BadgeNo EmpName Team
1524 John Smith Hawks
Set NoOf Columns = 3
Set Column Widths to 0"; 1.5" ;1"

What did does is... If you select a EmpName from the list, the BadgeNo
is captured to the BadgeNo field the combo is bound to. But, the combo will
"display" the EmpName. You've killed two birds with one stone... updated
BadgeNo, and displayed the EmpName.
Now, an unbound text control on the form, with the following
ControlSource...
=cboBadgeNo.Column(2)
This control will always display the contents of cboBadgeNo third
column... the Team.
(Combo columns are numbered 0, 1, 2, 3, etc... so Column(2) equals the
3rd colum.)

I have a sample A97 and A2003 sample file on my website (below) called
"Combo Updates Multiple Fields" that demomnstrates this method.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

combox auto fill 3
Input Masks - Leading Zeros 5
append query error 1
Auto fill not working 2
Completing fields based on data in another field 1
Submit forms 1
Find and copy 6
Multiple Criteria in query 2

Top