Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Password Macro Button (Access 2007)

    I have a piece of code that I have always used in Access 2000 through 2003 just fine. The code is attached to a macro button and it follows:

    ' ***************code begin************************

    Private Sub cmdOpenfrmEmployee_Click()

    Dim strPasswd

    strPasswd = InputBox("Enter Password", "Restricted Form")


    If strPasswd = "" Or strPasswd = Empty Then
    MsgBox "No Input Provided", vbInformation, "Required Data"
    Exit Sub
    End If

    If strPasswd = "admin" Then
    DoCmd.OpenForm "frmEmployee", acNormal
    Else
    MsgBox "Sorry, you do not have access to this form", _
    vbOKOnly, "Important Information"
    Exit Sub
    End If
    End Sub

    ' ****************end code**************************

    It doesn't do "anything" in Access 2007. Is there something I am missing with 2007? I am just starting (I know I am late) looking at the differences between Access 2003 and Access 2007. I am finding major differences when it comes to protecting the database as I have always done in 2007?

    Any advice on this?
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SOLVED: Password Macro Button (Access 2007)

    Nevermind...(smile)...there was a problem with certain "things not being enabled" in the form. I see this message a lot. I am assuming this is like the 2003 security settings being on high, medium and low...haven't found where I can change that yet...am sure to run acrossed it, but if you know where it might be, might save me some time. My code is working however since I enabled the option in the dialog that appeared...


    Nevermind...found it in the trust settings...so many places to look for new stuff in 2007...UGH! Sorry to bother ya, but hey someone else might ask, so here is the answer...TRUST settings...I looked it up in HELP, (smile)
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

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