Results 1 to 3 of 3
  1. #1
    EHittner is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2009
    Posts
    29

    Form "On Open" Event Password Code Not Working in .accde

    I thought I had the password issue down for opening a specific form in my db -- until I published it in .accde. I have one form in my multi-user db that I don't want outside sources to have access to. (Keep in mind that the general users of this db have no interest or clue in how to back-door access forms or form designs. So this simple solution is really all that is needed.) I inserted code in the On Open event of this particular form as follows:



    Private Sub Form_Open(Cancel As Integer)

    Dim pwd As String
    pwd = InputBox("Please Enter the Password")
    If pwd = "Password" Then
    MsgBox "You're In. Welcome!"
    Else
    MsgBox "Password incorrect. Access Denied"
    DoCmd.Close
    End If

    End Sub


    This worked perfectly when operating the .accdb database. However, when I published it in .accde format, the function is simply igonored and it opens the form right up without prompting for the password.

    Any other solutions to this?

  2. #2
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,167
    Sounds to me as though the code is just not firing. I would go back to the original bd and try to create the accde again. Just check that the code is working in the original db first.
    If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
    Not everyone can access an accdb, you may reach a broader audience by attaching in mdb format.

    Bob Fitzpatrick

    I have never failed. I have found a thousand ways that do not work!

    Microsoft Community Contributor Award (2011)



  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    2,915
    Does any code fire? In not, it's possible the folder where the .accde file resides hasn't been declared as 'trusted.'

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need VBA code/"Class Object" for a bound form
    By kewelch in forum Programming
    Replies: 6
    Last Post: 06-27-2013, 09:26 AM
  2. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  3. Replies: 12
    Last Post: 06-14-2010, 08:39 PM
  4. Replies: 3
    Last Post: 10-20-2009, 06:56 AM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums