DLookUp or SELECT

  • Thread starter Thread starter alhotch
  • Start date Start date
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.
 
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)
 
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.


.
 
Back
Top