I
ITistic
I am in the midst of modifying an existing Access database used by a
single office into one which is used by and stores data for multiple
offices. Data for all offices is stored in the same database. When the
database is initially opened a global variable is set to the value of
the office_id(s) that user is associated with. This can be one number
("1") or multiple numbers ("1", "2", "3"). I need to update all of the
existing queries in the database so that they only show data for
customers who belong to the office_id(s) the current logged in user is
associated with.
What I have tried initially is creating a function in a module called
"UserOfficeIDs" which returns a string of the comma-delimited
office_id(s) the current user has access to. I then modified one of
the queries so the criteria for the "office_id" field was set to "In
(UserOfficeIDs())". This did not work. When I output UserOfficeIDs()
as a field in the query I do see the correct data, so I know the
function is working properly. Does anybody else have any idea how I
can accomplish this?
single office into one which is used by and stores data for multiple
offices. Data for all offices is stored in the same database. When the
database is initially opened a global variable is set to the value of
the office_id(s) that user is associated with. This can be one number
("1") or multiple numbers ("1", "2", "3"). I need to update all of the
existing queries in the database so that they only show data for
customers who belong to the office_id(s) the current logged in user is
associated with.
What I have tried initially is creating a function in a module called
"UserOfficeIDs" which returns a string of the comma-delimited
office_id(s) the current user has access to. I then modified one of
the queries so the criteria for the "office_id" field was set to "In
(UserOfficeIDs())". This did not work. When I output UserOfficeIDs()
as a field in the query I do see the correct data, so I know the
function is working properly. Does anybody else have any idea how I
can accomplish this?