Can I reset one CurrentUser?

  • Thread starter Thread starter Bonnie
  • Start date Start date
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!!!
 
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
 
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!!!


.
 
Back
Top