using the results of a function for Criteria

G

Guest

Hello all,
First off this is a great newsgroup, so keep up the good work.

I am trying to have the criteria from multiple queries run a function that
will limit the amount of information each current user has access to. I am
able to do this if the user only have permission to one particular area, but
when 1 user has access to muliple areas I run into problems.

For example:
The areas would be RED, GREEN, BLUE, ORANGE, YELLOW

USER1 has been assigned to RED
USER2 has been assigned to BLUE and GREEN
USER3 has been assigned to RED, ORANGE and Yellow

So what I get the function to do is group all areas together for the current
user.

For instance say it was USER2 that was logged in the "FINDAREA" function
would retrieve the following "'BLUE' or 'GREEN'" as a string.
Within the query I would put the following "Like FindArea()".
This works for any user that is only assigned to 1 Area, but for users that
more then 1 it does not work.

Any help with this problem would be greatly appreciated.

Thanks
 
G

Guest

This question has been answered many times. In query builder when you put in
'red' and 'green' for criteria it writes in sql veiw as "WHERE
((
.[color]='red') and (
.[color]='green'))" however when you use
a function it will look like "WHERE ((
.[color]='red or green'))" That
is why it doesn't work. You need to use where clause of the docmd.open report
or build the where clause in code.

HTH
Martin J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top