Employee Table and retrieving data

sladetroityer

Registered User.
Local time
Today, 05:23
Joined
Oct 26, 2011
Messages
149
I have created an employee database for many different groups (departments) to use and I'd like to create a button that restricts or filters the data from the employee table for particular departments. Exampe: I have a form with all of the different groups labeled with cmd buttons and upon clicking the cmd botton I want only the Chassis data to be sent to the Main form instead of the main form showing all of the employees.
 
No, the first form is where I'd like the users to specify which group they work with by clicking that button which would bring them to the MAIN form only showing the records that apply.
 
The records are for people tracking. HR has their own system and won't let anybody access it. There are no confidential records to worry about. The link you sent me seems to have the right idea but I'm not sure what would go into the VBA code for my use.
 
Using the example in your first post, filter the relevant field by 'Chassis' (for example).
 
So the string would look like this?
DoCMD.openForm "frmNavagationMain", , ,"FinancialDepartment = '1250-0850" & Me.ControlName & " ' "
 
What if I wanted to use a query in that expression? I've already created all the queries for each department. Is that possible?
 
Yes something like that but without the spaces here --> & "'"
What is the 1250-0850 doing there?
 
1250-0850 is the department number but I think you're telling me to replace that with the query.
 
I wasn't sure what you were doing with that number and Me.ControlName. Your code should read:
Code:
DoCMD.openForm "frmNavagationMain", , ,"FinancialDepartment = '1250-0850'"
 
That looks great, now what if I wanted to use a query called "qselChassisEmployeeInformation"

The query retrieves the correct data and I'd rather sue the query because there are about 20 to 30 department numbers for each group.
 
Uggh, that's what I am trying to avoid. I don't want a form for every query. I want one form for all queries..... Is that possible.
 
Which is why I gave you the code. One form based on a query, the code filters the form's Record Source when applied.
 
Ok then one more issue. I have an employee table that has department info in each record which in turn is linked to the department number table which is where the queries are pulling from. The info in the Department table is like this:
1250-0860 = AVE-AVE: Advanced Engineering and because there are multiple department number for AVE I am filtering by Department Description as opposed to Dept. #. So my queries all say Like AVE*
 
And the problem is??

What does this "1250-0860 = AVE-AVE: Advanced Engineering" mean?

Use Department Number to filter your query.
 

Users who are viewing this thread

Back
Top Bottom