Lookup needs to fill two fields

H

hntsignif

OK this may be easy but I am stumped.

I have a table "Employees" it has two columns: Employee and GroupTitle

I have a second table that tracks points per job called "PointTrack" and I
have used a lookup column to pull in the Employee Name. The lookup column
shows a drop down with the employee and grouptitle fields because some
employees are in more than one group and this allows them to choose the
correct group.

What I need is to have both the Employee and group title visible in the form
based on the PointTrack table. Right now, I can have them choose in the
dropdown seeing both fields, but only the employee name shows up once the
choice is made.

How can I have both fields show in the box once the choice has been made in
the dropdown?
 
N

NG

Hi,

solution 1: show a calculated field in the combobox, concatenating both fields
solution 2: add a new text field and set as control source the calculation
= forms![name form]![name combobox].Column(2)

the number 2 has to be replaced with the actual column number you want to
display, taking in account the cols start numbering from 0

grts
NG
 
J

John W. Vinson

OK this may be easy but I am stumped.

I have a table "Employees" it has two columns: Employee and GroupTitle

I have a second table that tracks points per job called "PointTrack" and I
have used a lookup column to pull in the Employee Name. The lookup column
shows a drop down with the employee and grouptitle fields because some
employees are in more than one group and this allows them to choose the
correct group.

What I need is to have both the Employee and group title visible in the form
based on the PointTrack table. Right now, I can have them choose in the
dropdown seeing both fields, but only the employee name shows up once the
choice is made.

How can I have both fields show in the box once the choice has been made in
the dropdown?

The GroupTitle field (and the name, for that matter) should simply NOT EXIST
in the second table - only the EmployeeID. (I hope you do have an EmployeeID
primary key, rather than using employee names as if they were unique, since
they aren't!)

What you can do is put a textbox on the form with a control source

=comboboxname.Column(n)

where n is the *zero based* index of the field you want to display; e.g. if
the combo box has fields for the EmployeeID, LastName, FirstName and
GroupTitle you would use (3) to display the fourth column.
 

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