A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Lookup needs to fill two fields



 
 
Thread Tools Display Modes
  #1  
Old February 10th, 2010, 06:05 PM posted to microsoft.public.access.tablesdbdesign
hntsignif
external usenet poster
 
Posts: 14
Default Lookup needs to fill two fields

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?


  #2  
Old February 10th, 2010, 06:40 PM posted to microsoft.public.access.tablesdbdesign
NG
external usenet poster
 
Posts: 56
Default Lookup needs to fill two fields


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

"hntsignif" wrote:

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?


  #3  
Old February 10th, 2010, 07:24 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Lookup needs to fill two fields

On Wed, 10 Feb 2010 09:05:01 -0800, hntsignif
wrote:

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.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.