Results 1 to 3 of 3
  1. #1
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231

    OnLoad is asking for password twice.

    I have the following code in On Load and it asks for the password twice and still opens the form. Does the same thing in On Open too. What am I doing wrong?
    Private Sub Form_Open(Cancel As Integer)
    Dim PassWord As String
    PassWord = InputBox("Enter Password")
    If PassWord = "Oscar" Then
    DoCmd.OpenForm "Deans Page"
    Else
    MsgBox ("you are not authorized to use the Deans Page")
    End If
    End Sub

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Try putting the code in event FORM LOAD.
    not open.
    it actually shouldn't be in any form...it should be in code.
    why open a form,to ask permission to open a form?

  3. #3
    khughes46 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Grapevine, TX
    Posts
    231
    I forget the Cancel = True. It is working fine.

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

Similar Threads

  1. Onload Filter Question
    By alexandervj in forum Access
    Replies: 6
    Last Post: 03-21-2014, 12:30 PM
  2. How can I filter a subform onLoad?
    By alexandervj in forum Access
    Replies: 1
    Last Post: 03-20-2014, 04:08 PM
  3. resize linked image onload
    By sconard in forum Reports
    Replies: 5
    Last Post: 09-25-2013, 11:09 AM
  4. Record Check on Form OnLoad
    By tramp82 in forum Forms
    Replies: 10
    Last Post: 10-19-2011, 07:19 PM
  5. Replies: 36
    Last Post: 10-04-2011, 11:19 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
  •  
Other Forums: Microsoft Office Forums