Opening a form with a recordsource based on multiple fields...

SimonSezz

Registered User.
Local time
Yesterday, 21:16
Joined
Jun 19, 2008
Messages
30
I have a form in my application named "frmWorkHistoryDetails", and it is opened when viewing an employee's information in "frmEmployeeInfo" and clicking on a "Details" button in subform "sfrmWorkHistoryList". The form "frmWorkHistoryDetails" needs to know what record to find in a query based upon the EmployeeID and ShopID, which are both stored in seperate tables (tblEmployees and tblShops).

Here is what the query, "qryWorkHistoryDetail" looks like:

Code:
SELECT tblWorkHistory.*, tblEmployees.SSN, tblEmployees.LastName, tblEmployees.FirstName, tblEmployees.MiddleInitial, tblShops.ShopNumber
FROM tblShops INNER JOIN (tblEmployees INNER JOIN tblWorkHistory ON tblEmployees.ID=tblWorkHistory.EmployeeID) ON tblShops.ID=tblWorkHistory.ShopID;

And here is a picture of the form "frmEmployeeInfo"...

formstuff.gif
 
Here is what it looks like

Code:
SELECT tblWorkHistory.*
,      tblEmployees.SSN
,      tblEmployees.LastName
,      tblEmployees.FirstName
,      tblEmployees.MiddleInitial
,      tblShops.ShopNumber
FROM tblShops 
INNER JOIN (tblEmployees 
INNER JOIN tblWorkHistory ON tblEmployees.ID=tblWorkHistory.EmployeeID) 
                          ON tblShops.ID=tblWorkHistory.ShopID;

However I do not understand, what is your question?
 
Basically how do I open the form "frmWorkHistoryDetails" and have it look up a record based on two parameters from the form "frmEmployeeInfo"
 
You can pass information from one form to another in the "where" of the Openform command.

Read the Access help on the OpenForm, come back with specific questions if you have them.
 
Alright I used the Where function and everything works. Thank you.
 

Users who are viewing this thread

Back
Top Bottom