Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Display Based on Login (2000)

    Hi everyone,

    I'm trying to create an application that will read who is logging in (I have set up the security on this already) and, based on that information, will show one of two forms on startup. The people who will be accessing this are broken down into two separate groups -- "Tech Services" and "Liaisons". I have created separate input forms for both of these groups. If a user is in the group of "TS", then they see the Tech Services form, and if they're "LS" they see the Liaison form.

    I'm thinking that this has to do with some kind of module, but I'm not sure where to start???

    Thanks,
    Kindra

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Display Based on Login (2000)

    MSKB article ACC2000: Sample Functions to Check User and Group Information contains a function CurrentUserInGroup that you can use to check if the current user is a member of a specified group. Note that the function requires that you have created a user named Developer who is member of the Admins group and for whom no password has been set.

    Copy this function into a standard module. You must have a reference to the Microsoft DAO 3.6 Object Library.

    Next, create a function in astandard module (it can be the same module that contains CurrentUserInGroup):

    Public Function StartForm()
    If CurrentUserInGroup("TS") Then
    DoCmd.OpenForm "frmTechServices"
    ElseIf CurrentUserInGroup("LS") Then
    DoCmd.OpenForm "frmLiaison"
    End If
    End Function

    Adapt group names and form names as needed. Finally, create a macro with one action RunCode with StartForm() as argument. Save this macro as AutoExec. This will cause it to be run automatically when the database is opened.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2003
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Display Based on Login (2000)

    I can't believe that I actually was able to get this to work! Your directions couldn't have been clearer. Thanks Hans! [img]/forums/images/smilies/smile.gif[/img]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •