Results 1 to 3 of 3
  1. #1
    RedGoneWILD is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    105

    Close Form button not working

    Hi,



    I have a button on my switchboard that needs to close the switchboard and open the login form. My code is below. I have tried me.close as well and I just get no response when clicking the button. It doesn't open form login. It doesn't close the switchboard. It's just a dead button right now. On the switchboard form, I have the "Close Button" property set to no. I turned that back to yes to see if it made a difference, but still nothing. This same type of code has worked in other parts of my program to close a form and open another, but it won't work on this particular form for some reason. What am I doing wrong?

    Code:
    Private Sub btnLogOut_Click()
    On Error GoTo btnLogOut_Err
    
    
        DoCmd.OpenForm "frmLogIn", acNormal
        DoCmd.Close acForm, "Switchboard1"
        
    btnLogOut_Exit:
        Exit Sub
    
    
    btnLogOut_Err:
        MsgBox Err.Description
        Resume btnLogOut_Exit
    End Sub

  2. #2
    Rod is offline Expert
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    The only thing I can suggest is that there is a discrepancy between the name of the button on the form and the name here in the code. Make sure it is named btnLogOut on the form. A difference in name will produce the effect you describe.

  3. #3
    RedGoneWILD is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    105
    Thanks for the reply. I had a 0 instead of O by accident. Just wasn't paying attention. DOH!

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

Similar Threads

  1. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  2. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  3. Replies: 1
    Last Post: 11-28-2011, 04:06 PM
  4. Disable master form close button
    By Carpy01 in forum Forms
    Replies: 3
    Last Post: 12-31-2010, 05:41 PM
  5. Replies: 4
    Last Post: 09-10-2009, 03:09 AM

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