Group:  Microsoft Access ยป microsoft.public.access.security
Thread: Load Form Based on Current User's Group

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Load Form Based on Current User's Group
Sprinks 16.08.2006 15:14:02
I have a Timesheet application for which I will be using Security for the
first time. Most users will have read/edit permissions for a single form, by
which they enter their time spent on various projects. I would like to load
an Administration Menu form on startup for those in the Admins group, and the
Timesheet form for the Users.

Prior to securing the database, I've set the Adminstration Menu as the form
to load on startup, and used a DLookup call in the Form_Open event to
determine the value of a stored "FullAdminRights" field for the current user.
If the user doesn't have the rights, the form closes and the Timesheet form
opens.

I'd rather let Security handle this, but if I remove User permissions for
the Administration Menu form, will the Form_Open event procedure even run?
If not, how can I load the Timesheet form?

Thanks for all help.
Sprinks
Re: Load Form Based on Current User's Group
"Lynn Trapp" <ltrapp_NOSPAM[ at ]ltcomputerdesigns.com> 16.08.2006 16:56:52
Read the Security FAQ for the UserInGroup function. You button for opening
your forms could, then be something like this

If UserInGroup("Admins") then
Open Administration menu form
Else
Open Timesheet form
End if

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html



"Sprinks" <Sprinks[ at ]discussions.microsoft.com> wrote in message
news:92C02700-758C-47E6-8223-D512B7F2ECB4[ at ]microsoft.com...
[Quoted Text]
>I have a Timesheet application for which I will be using Security for the
> first time. Most users will have read/edit permissions for a single form,
> by
> which they enter their time spent on various projects. I would like to
> load
> an Administration Menu form on startup for those in the Admins group, and
> the
> Timesheet form for the Users.
>
> Prior to securing the database, I've set the Adminstration Menu as the
> form
> to load on startup, and used a DLookup call in the Form_Open event to
> determine the value of a stored "FullAdminRights" field for the current
> user.
> If the user doesn't have the rights, the form closes and the Timesheet
> form
> opens.
>
> I'd rather let Security handle this, but if I remove User permissions for
> the Administration Menu form, will the Form_Open event procedure even run?
> If not, how can I load the Timesheet form?
>
> Thanks for all help.
> Sprinks


Re: Load Form Based on Current User's Group
Sprinks 16.08.2006 17:05:01
Thanks, Lynn.

How could I have this code execute on opening the database? I thought of
putting it in another form, set as the default to open, but I'd think there'd
be a cleaner way.

Thank you.
Sprinks

"Lynn Trapp" wrote:

[Quoted Text]
> Read the Security FAQ for the UserInGroup function. You button for opening
> your forms could, then be something like this
>
> If UserInGroup("Admins") then
> Open Administration menu form
> Else
> Open Timesheet form
> End if
>
> --
> Lynn Trapp
> MS Access MVP
> www.ltcomputerdesigns.com
> Access Security: www.ltcomputerdesigns.com/Security.htm
> Jeff Conrad's Access Junkie List:
> http://home.bendbroadband.com/conradsystems/accessjunkie.html
>
>
>
> "Sprinks" <Sprinks[ at ]discussions.microsoft.com> wrote in message
> news:92C02700-758C-47E6-8223-D512B7F2ECB4[ at ]microsoft.com...
> >I have a Timesheet application for which I will be using Security for the
> > first time. Most users will have read/edit permissions for a single form,
> > by
> > which they enter their time spent on various projects. I would like to
> > load
> > an Administration Menu form on startup for those in the Admins group, and
> > the
> > Timesheet form for the Users.
> >
> > Prior to securing the database, I've set the Adminstration Menu as the
> > form
> > to load on startup, and used a DLookup call in the Form_Open event to
> > determine the value of a stored "FullAdminRights" field for the current
> > user.
> > If the user doesn't have the rights, the form closes and the Timesheet
> > form
> > opens.
> >
> > I'd rather let Security handle this, but if I remove User permissions for
> > the Administration Menu form, will the Form_Open event procedure even run?
> > If not, how can I load the Timesheet form?
> >
> > Thanks for all help.
> > Sprinks
>
>
>
Re: Load Form Based on Current User's Group
DJ Roberts 16.08.2006 18:21:02
May be a better way, but sometimes I set my database to load up to a form
dedicated to routing users to the proper form. It has a script similar to
the one Lynn posted set to the Open event, and closes as soon as that script
runs.

Re: Load Form Based on Current User's Group
"Lynn Trapp" <ltrapp_NOSPAM[ at ]ltcomputerdesigns.com> 16.08.2006 19:25:17
Have the startup form open invisible and in the Open event of that form run
the code to either open the administrator form or the Time entry form.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html



"Sprinks" <Sprinks[ at ]discussions.microsoft.com> wrote in message
news:DDC4245E-D4F5-45BA-B2E0-5A25BC472B44[ at ]microsoft.com...
[Quoted Text]
> Thanks, Lynn.
>
> How could I have this code execute on opening the database? I thought of
> putting it in another form, set as the default to open, but I'd think
> there'd
> be a cleaner way.
>
> Thank you.
> Sprinks
>
> "Lynn Trapp" wrote:
>
>> Read the Security FAQ for the UserInGroup function. You button for
>> opening
>> your forms could, then be something like this
>>
>> If UserInGroup("Admins") then
>> Open Administration menu form
>> Else
>> Open Timesheet form
>> End if
>>
>> --
>> Lynn Trapp
>> MS Access MVP
>> www.ltcomputerdesigns.com
>> Access Security: www.ltcomputerdesigns.com/Security.htm
>> Jeff Conrad's Access Junkie List:
>> http://home.bendbroadband.com/conradsystems/accessjunkie.html
>>
>>
>>
>> "Sprinks" <Sprinks[ at ]discussions.microsoft.com> wrote in message
>> news:92C02700-758C-47E6-8223-D512B7F2ECB4[ at ]microsoft.com...
>> >I have a Timesheet application for which I will be using Security for
>> >the
>> > first time. Most users will have read/edit permissions for a single
>> > form,
>> > by
>> > which they enter their time spent on various projects. I would like to
>> > load
>> > an Administration Menu form on startup for those in the Admins group,
>> > and
>> > the
>> > Timesheet form for the Users.
>> >
>> > Prior to securing the database, I've set the Adminstration Menu as the
>> > form
>> > to load on startup, and used a DLookup call in the Form_Open event to
>> > determine the value of a stored "FullAdminRights" field for the current
>> > user.
>> > If the user doesn't have the rights, the form closes and the Timesheet
>> > form
>> > opens.
>> >
>> > I'd rather let Security handle this, but if I remove User permissions
>> > for
>> > the Administration Menu form, will the Form_Open event procedure even
>> > run?
>> > If not, how can I load the Timesheet form?
>> >
>> > Thanks for all help.
>> > Sprinks
>>
>>
>>


Re: Load Form Based on Current User's Group
Sprinks 16.08.2006 19:53:01
Thank you Lynn and DJ.

Sprinks

"Lynn Trapp" wrote:

[Quoted Text]
> Have the startup form open invisible and in the Open event of that form run
> the code to either open the administrator form or the Time entry form.
>
> --
> Lynn Trapp
> MS Access MVP
> www.ltcomputerdesigns.com
> Access Security: www.ltcomputerdesigns.com/Security.htm
> Jeff Conrad's Access Junkie List:
> http://home.bendbroadband.com/conradsystems/accessjunkie.html
>
>
>
> "Sprinks" <Sprinks[ at ]discussions.microsoft.com> wrote in message
> news:DDC4245E-D4F5-45BA-B2E0-5A25BC472B44[ at ]microsoft.com...
> > Thanks, Lynn.
> >
> > How could I have this code execute on opening the database? I thought of
> > putting it in another form, set as the default to open, but I'd think
> > there'd
> > be a cleaner way.
> >
> > Thank you.
> > Sprinks
> >
> > "Lynn Trapp" wrote:
> >
> >> Read the Security FAQ for the UserInGroup function. You button for
> >> opening
> >> your forms could, then be something like this
> >>
> >> If UserInGroup("Admins") then
> >> Open Administration menu form
> >> Else
> >> Open Timesheet form
> >> End if
> >>
> >> --
> >> Lynn Trapp
> >> MS Access MVP
> >> www.ltcomputerdesigns.com
> >> Access Security: www.ltcomputerdesigns.com/Security.htm
> >> Jeff Conrad's Access Junkie List:
> >> http://home.bendbroadband.com/conradsystems/accessjunkie.html
> >>
> >>
> >>
> >> "Sprinks" <Sprinks[ at ]discussions.microsoft.com> wrote in message
> >> news:92C02700-758C-47E6-8223-D512B7F2ECB4[ at ]microsoft.com...
> >> >I have a Timesheet application for which I will be using Security for
> >> >the
> >> > first time. Most users will have read/edit permissions for a single
> >> > form,
> >> > by
> >> > which they enter their time spent on various projects. I would like to
> >> > load
> >> > an Administration Menu form on startup for those in the Admins group,
> >> > and
> >> > the
> >> > Timesheet form for the Users.
> >> >
> >> > Prior to securing the database, I've set the Adminstration Menu as the
> >> > form
> >> > to load on startup, and used a DLookup call in the Form_Open event to
> >> > determine the value of a stored "FullAdminRights" field for the current
> >> > user.
> >> > If the user doesn't have the rights, the form closes and the Timesheet
> >> > form
> >> > opens.
> >> >
> >> > I'd rather let Security handle this, but if I remove User permissions
> >> > for
> >> > the Administration Menu form, will the Form_Open event procedure even
> >> > run?
> >> > If not, how can I load the Timesheet form?
> >> >
> >> > Thanks for all help.
> >> > Sprinks
> >>
> >>
> >>
>
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net