DLookUp or SELECT

A

alhotch

I have a table of EMPLOYESS (tblEmployees). Fields are EmployeeID; FirstName;
LastName. I have another table of ACTIVITIES (tblActivities). One of the
fileds in the tblActivities table is PersonID which contains the number of
the EmployeeID in the tblEmployees table.

I want the resulting "match" between the [tblActivities.PersonID] and
[tblEmployees.EmployeeID to populate a Text Box with the results of this
"equal compare" AND INCLUDE the FirstName and LastName fields.

I am lost as to how to do this.
 
S

Steve

Create a query based on TblEmployees and TblActivities. Besure that
EmployeeID in TblEmployees is joined to EmployeeID in TblActivities. Put the
following expression in the first field of the query:
EmployeeName = [FirstName] & " " & [LastName]
fill the other fields of the query with the other fields you need from the
two tables. Use this query as the recordsource of the form or report you are
working on. Set the controlsource of the textbox to EmployeeName.

Steve
(e-mail address removed)
 
A

alhotch

DONE ! ANd it now works ! The "join" aspect is what I was missing.

Thanks, Steve.

Steve said:
Create a query based on TblEmployees and TblActivities. Besure that
EmployeeID in TblEmployees is joined to EmployeeID in TblActivities. Put the
following expression in the first field of the query:
EmployeeName = [FirstName] & " " & [LastName]
fill the other fields of the query with the other fields you need from the
two tables. Use this query as the recordsource of the form or report you are
working on. Set the controlsource of the textbox to EmployeeName.

Steve
(e-mail address removed)




alhotch said:
I have a table of EMPLOYESS (tblEmployees). Fields are EmployeeID;
FirstName;
LastName. I have another table of ACTIVITIES (tblActivities). One of the
fileds in the tblActivities table is PersonID which contains the number of
the EmployeeID in the tblEmployees table.

I want the resulting "match" between the [tblActivities.PersonID] and
[tblEmployees.EmployeeID to populate a Text Box with the results of this
"equal compare" AND INCLUDE the FirstName and LastName fields.

I am lost as to how to do this.


.
 

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

DLookUp 4
Crosstab Query - External Criteria 9
Combo Box 2
Database/form design 1
Employee Time Tracker 2
Data Type Conflict 7
Lookup 2
Error 2448 on Form with DLookup 0

Top