Results 1 to 8 of 8
  1. #1
    pls001 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jun 2013
    Posts
    3

    Close a form from another form


    I created a form (frmUSERS AND PASS) to access a menu located in another form(frmREPORTS MENU). frmUSERS AND PASS allow users to open the report menu and execute whatever they want depending on a security level. When I get into the frmREPORTS MENU I'm not able to close the frm USERS AND PASS. I don't understand why. I tried several approaches with no success. Please help. thank you all in advance

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Are you saying that Access refuses to let you close them OR are you looking for a way to close them from an other form.
    Your title says one thing however your post says something different.

    Please explain what it is you want.

    Dale

  3. #3
    pls001 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jun 2013
    Posts
    3
    I'm looking for a way to close the frmUSERS AND PASS form, after opening the from frmREPORTS MENU. I used DoCmd.close "frmUSERS AND PASS" ON OPEN event OF THE frmREPOTS MENU.
    I tried using also the ON LOAD event and other things but I get the same results ACTION FAILED.

  4. #4
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    I used DoCmd.close "frmUSERS AND PASS" ON OPEN event OF THE frmREPOTS MENU
    Docmd.Close "frmUsers", acSavNo
    Docmd.Close "frmPass",acsaveNo

    Dale

  5. #5
    pls001 is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jun 2013
    Posts
    3
    Yes Dale,
    I used docmd.close "frmUSERS AND PASS", acSavNo.


    Quote Originally Posted by rzw0wr View Post
    Docmd.Close "frmUsers", acSavNo
    Docmd.Close "frmPass",acsaveNo

    Dale

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I think your code is missing a comma. Try:
    DoCmd.close , "frmUSERS AND PASS"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I think your code is missing a comma. Try:
    DoCmd.close , "frmUSERS AND PASS"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    By the way, if you will always close the first form after you open the second form, you can do it in the first form.

    Code:
    Private Sub cmdNext_Click()
    On Error GoTo Err_cmdNext_Click
        Dim stDocName As String
        Dim stLinkCriteria As String
    
        stDocName = "frmNextFormName"
        DoCmd.OpenForm stDocName, , , stLinkCriteria
        DoCmd.Close acForm, Me.Name
        
    Exit_cmdNext_Click:
        Exit Sub
    
    Err_cmdNext_Click:
        MsgBox Err.Description
        Resume Exit_cmdNext_Click
        
    End Sub

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. Close Form A After Opening Form B
    By M4ttyC88 in forum Programming
    Replies: 6
    Last Post: 01-18-2012, 02:06 AM
  4. Replies: 2
    Last Post: 06-20-2011, 03:10 PM
  5. Open Form and Close Previous Form
    By gerrymouse1 in forum Forms
    Replies: 3
    Last Post: 04-19-2011, 05:42 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