Can I reset one CurrentUser?

B

Bonnie

Hi there! Using A02 on XP. I have a form that opens and
shows only the records where the field [Adm]=CurrentUser
(). Works great. However, I have 2 folks sharing work (MZS
and SKR). [Adm]=MZS and though SKR has none assigned to
her, she assists MZS. She needs to open [Adm]=MZS. As it
is, she is told she has no data to display. My form's
query has CurrentUser() as criteria in the [Adm] field.

What can I do to accomplish this? Some sort of If
CurrentUser()="SKR" then [Adm]="MZS" End if? Where would I
put it? On the OnClick event of form open button or OnOpen
event of form? Not sure.

Thanks in advance for any advice or help on this!!!
 
N

Nikos Yannacopoulos

Bonnie,

The simple solution is to replace your CurrentUser() criterion in the query
with:

IIf(CurrentUser() = "SKR", "MZS",CurrentUser())

This is not a neat solution, though, especially if you foresee more similar
situations in the future. In that case I would introduce a new table
WorkGroups, with a PK field for User and a field for WkGrp, store WkGrp
instead of User in the main table, and filter on WkGrp by looking up the
group the curent user belongs to. This will give you flexibility to manage
users and workgroups as they former come and go and the latter change, by
simply maintaining data in a table, without having to alter the design.

HTH,
Nikos
 
B

Bonnie

That is EXACTLY what I needed!!! You are wonderful! Thanks
very much for the info and I really appreciate the
additional advice. Works beautifully!

I sincerely thank you for being willing to help others. I
love these newsgroups!!!
-----Original Message-----
Bonnie,

The simple solution is to replace your CurrentUser() criterion in the query
with:

IIf(CurrentUser() = "SKR", "MZS",CurrentUser())

This is not a neat solution, though, especially if you foresee more similar
situations in the future. In that case I would introduce a new table
WorkGroups, with a PK field for User and a field for WkGrp, store WkGrp
instead of User in the main table, and filter on WkGrp by looking up the
group the curent user belongs to. This will give you flexibility to manage
users and workgroups as they former come and go and the latter change, by
simply maintaining data in a table, without having to alter the design.

HTH,
Nikos

Hi there! Using A02 on XP. I have a form that opens and
shows only the records where the field [Adm]=CurrentUser
(). Works great. However, I have 2 folks sharing work (MZS
and SKR). [Adm]=MZS and though SKR has none assigned to
her, she assists MZS. She needs to open [Adm]=MZS. As it
is, she is told she has no data to display. My form's
query has CurrentUser() as criteria in the [Adm] field.

What can I do to accomplish this? Some sort of If
CurrentUser()="SKR" then [Adm]="MZS" End if? Where would I
put it? On the OnClick event of form open button or OnOpen
event of form? Not sure.

Thanks in advance for any advice or help on this!!!


.
 

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