brunomesquita
New member
- Local time
- Today, 09:30
- Joined
- Jun 1, 2021
- Messages
- 9
Hi guys.
I'm in a corner here, I have tried several approaches but none worked.
I have a query based on my employee table and I want it to filter the employee list depending on two fields:
EmployeeTypeID: IIf([Forms]![frm2Switch]![txtUserType]=2,([tblEmployees].[EmployeeTypeID])>=2,IIf([Forms]![frm2Switch]![txtUserType]=3,([tblEmployees].[EmployeeTypeID])>3,4)) - this is working by the way.
EmployeeManager: here is where I'm having problems. I want the query to check the txtUserType on the form and if it is equal to 2 (manager type), then show all employees on the list, else (if 3, supervisor) use the txtUserID as the EmployeeManager filter.
Did I explain this right?!
First I want my query to check if txtUserType is a manager type [2] if so then show all employee types [2, 3 or4].
Second I want the query to check if txtUserType is a manager [2] if so then show all employees else, filter the result using the txtUserID as the [EmployeeManager] filter.
There, now I think it is clear.
Any pointers would be much appreciated!
Cheers,
Bruno
I'm in a corner here, I have tried several approaches but none worked.
I have a query based on my employee table and I want it to filter the employee list depending on two fields:
EmployeeTypeID: IIf([Forms]![frm2Switch]![txtUserType]=2,([tblEmployees].[EmployeeTypeID])>=2,IIf([Forms]![frm2Switch]![txtUserType]=3,([tblEmployees].[EmployeeTypeID])>3,4)) - this is working by the way.
EmployeeManager: here is where I'm having problems. I want the query to check the txtUserType on the form and if it is equal to 2 (manager type), then show all employees on the list, else (if 3, supervisor) use the txtUserID as the EmployeeManager filter.
Did I explain this right?!
First I want my query to check if txtUserType is a manager type [2] if so then show all employee types [2, 3 or4].
Second I want the query to check if txtUserType is a manager [2] if so then show all employees else, filter the result using the txtUserID as the [EmployeeManager] filter.
There, now I think it is clear.
Any pointers would be much appreciated!
Cheers,
Bruno