Results 1 to 3 of 3
  1. #1
    benjfabian is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    2

    Unhappy microsoft access cant find the Form"FRM_LOGIN

    Hello guys,



    I actually don't have knowledge about codes and I'm just following youtube samples.

    I'm just trying my luck here maybe someone can help me to solve this.

    Private Sub btnLogout_Click()On Error GoTo btnLogoutErrHandler

    Dim db As DatabaseSet db = CurrentDb()

    db.Execute "UPDATE TBL_LOGIN_LOG SET TBL_LOGIN_LOG.LOGOUT_TIME=NOW()" _
    & "WHERE TBL_LOGIN_LOG.LOGOUT_TIME Is Null AND TBL_LOGIN_LOG.USERNAME='" + Forms!FRM_LOGIN!txtUsername + "'"

    DoCmd.Close acForm, Me.Name
    DoCmd.Close acForm, "FRM_LOGIN"
    DoCmd.OpenForm "FRM_LOGIN"

    btnLogoutErrExit:
    Exit Sub
    btnLogoutErrHandler:MsgBox Err.Description, vbExclamation, "Oops! Error No- " & Err.Number
    Resume btnLogoutErrExit
    End Sub

    and when I'm going to Click the Logout Button in the Log In Form it shows a message that Microsoft Access can't find the form "FRM_LOGIN"


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    You cannot have code in a form, then CLOSE the form, then continue with more code.
    once the form closes, the code vanishes.

    open the new form, THEN close the previous form.
    use full path names, not Me.form.

  3. #3
    benjfabian is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2016
    Posts
    2
    What should I write now?

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

Similar Threads

  1. Replies: 11
    Last Post: 02-06-2016, 01:00 PM
  2. Replies: 4
    Last Post: 06-25-2014, 01:44 PM
  3. Replies: 9
    Last Post: 06-08-2012, 07:52 AM
  4. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  5. Replies: 1
    Last Post: 06-07-2011, 09:10 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