DLookup to populate textbox

G

Guest

I have a very basic form. I have Employee ID, First Name, Last Name, Hire
Date, and Score as my fields in the form that populates my Score database.

When the Employee ID is filled in I want the First Name, Last Name, and Hire
Date to automatically populate. Then the usuer will just have to fill in the
Score.

I am new to Access and need help!

Thank you to any and all that can help,
Miah
 
A

Al Campagna

miah,
Because your capturing the EmpID, there's no need to "capture" the ancillary
information. Since you have the EmpID, you can always re-relate that to the ancillary
info, "on the fly" in any subsequent form, query, or report.
All you need to do is "display" that info for the user.
I suggest a combo box (ex. cboEmpID) with a query behind it that lists all the
legitimate EmpIDs... and the ancillary info... and bind that combo to your EmpID table
field.
Col0 Col1 Col2 Col3
EmpID LastName FirstName HireDate
123 Smith Bob 1/1/06

Create 3 unbound Text controls.
In one of those put this ControlSource...
= cboEmpID.Column(1) 'displays the LastName from the combo
In the second text control
= cboEmpID.Column(2) 'displays the FirstName from the combo
In the third...
= cboEmpID.Column(3) 'displays the HireDate from the combo

Any time you select an EmpID, the text controls will update accordingly... then just
fill in your bound Score field.
 
G

Guest

Thank you soooo much for your help...Ok...it worked for the first text box
but when I try to enter = cboEmpID.Column(2) it populates nothing. I'm
probably not doing something correctly.
 
A

Al Campagna

miah,
If you have the 4 columns in the query I suggested then...
NoOfCols = 4
ColumnWidths = .5"; 1"; 1"; .75" (adjust to suit)
ListWidth = 3.25' (adjust accordingly to total ColumnWidths)
and make sure each field is set to "Show" in the combo query.
 

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

Top