Results 1 to 11 of 11
  1. #1
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84

    Log In Ending

    Need your help on two things

    How do i state at the end of this VBA to Close if every is True.
    It currently stays open.




    Private Sub Command1_Click()
    If IsNull(Me.txtLoginID) Then
    MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
    Me.txtLoginID.SetFocus
    ElseIf IsNull(Me.txtPassword) Then
    MsgBox "Please enter Password", vbInformation, "Password Required"
    Me.txtPassword.SetFocus
    Else
    'process the job
    If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin]='" & Me.txtLoginID.Value & "'"))) Or _
    (IsNull(DLookup("Password", "tblUser", "Password='" & Me.txtPassword.Value & "'"))) Then
    MsgBox "Incorrect LoginID or Password"
    Else
    'MsgBox "LoginID and Password correct"
    DoCmd.OpenForm "Navigation form"
    End If


    End If


    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Check out:

    DoCmd.Close

    with the appropriate arguments.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84
    that didnt work

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What exactly didn't work? Post the code, not just "didn't work".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84
    Private Sub Command1_Click()
    If IsNull(Me.txtLoginID) Then
    MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
    Me.txtLoginID.SetFocus
    ElseIf IsNull(Me.txtPassword) Then
    MsgBox "Please enter Password", vbInformation, "Password Required"
    Me.txtPassword.SetFocus
    Else
    'process the job
    If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin]='" & Me.txtLoginID.Value & "'"))) Or _
    (IsNull(DLookup("Password", "tblUser", "Password='" & Me.txtPassword.Value & "'"))) Then
    MsgBox "Incorrect LoginID or Password"
    Else
    'MsgBox "LoginID and Password correct"
    DoCmd.Close acForm(Login)
    DoCmd.OpenForm "Navigation form"


    End If
    End If




    End Sub

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84
    Perfect and got it. Thanks Just need to read that in detail and it explain everything.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84
    Hey quick where can i go to learn how to configure the setting under the options for Login. For example,

    1. I would like to have a Icon Button for Access database. I cant get that to work

    2. When i click on that button. Only that Form comes up without the Microsoft Access background.

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I'd start a new thread for that. I've never tried to hide the Access background, though I think it can be done.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    GCLIFTON is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    84
    Thanks i will do just that

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

Similar Threads

  1. Starting and Ending Dates in Query
    By NewbyForAccess in forum Queries
    Replies: 9
    Last Post: 10-08-2015, 08:04 PM
  2. Alert for Position ending in 6 months
    By enquiries in forum Access
    Replies: 2
    Last Post: 04-22-2014, 03:09 PM
  3. Image as never ending wallpaper
    By 95DSM in forum Database Design
    Replies: 1
    Last Post: 07-30-2010, 10:02 AM
  4. Calculating Beginning and Ending page numbers
    By sabraham in forum Access
    Replies: 3
    Last Post: 01-07-2010, 12:36 PM
  5. Viewing ending zeros in decimal
    By duecesup in forum Reports
    Replies: 0
    Last Post: 12-11-2008, 02:45 PM

Tags for this Thread

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