Results 1 to 2 of 2
Thread: iif and dlookup (2000)
2004-10-04, 10:19 #1
- Join Date
- May 2003
- Manchester, Gtr Manchester, England
- Thanked 0 Times in 0 Posts
iif and dlookup (2000)
Hello, a bit of background: have a situation where I have a table of managers and table of team members. On a form where managers can view team members a team manager would only be able to view his team members, I have created this restriction by having a module that reads the logon ID of the manager then on a query that is the source for the combo for team members the criteria restricts to members for the read team manager logon. Thus: dlookup("[team manager id]", "tbllTeam Manager","[logon]=logonmodule ()"). sits on the default value of my team manager field on the form. The query for the team member combo reads the value of the team manager field. This works fine, now however a third table with Executive managers exists, I want these executives to be able to view all team members. How can I amend the dlookup to say if the logon is an executive manager logon from the executive table then don't restirct the team members that are shown, if it is a team manager then do the filter?
Hope this makes sense.
Many thanks Darren.
2004-10-04, 10:42 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: iif and dlookup (2000)
I don't know the exact design of your query, but you can probably do it like this:
In the first empty column of the query design grid, enter
DLookup("[executive manager id]", "tbllEcecutive Manager","[logon]=logonmodule()"
with the correct names for the field and table substituted. Clear the Show check box for this column. Enter
Is Not Null
in the first criteria cell in this column that sits in a completely blank row (up to now). In other words, you must not enter this criteria in the same row that contains the criteria for the team manager ID.
Note: I think it would be easier if you put the executive managers in the same table as the other managers, with a Yes/No field to indicate whether it's an executive manager or not.