Results 1 to 3 of 3

Thread: Close Form

  1. #1
    Join Date
    Jun 2002
    Location
    Houston, TX
    Posts
    116

    Unanswered: Close Form

    I have a start up form that has choices that opens other forms. On each of the forms is a command button that allows them to return to the startup form. I want that button to close the current form and return to the startup form. I've got the startup part but what is the code to close the current form??

    Private Sub StartOptions_Click()
    On Error GoTo Err_StartOptions_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "StartOptions"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_StartOptions_Click:
    Exit Sub

    Err_StartOptions_Click:
    MsgBox Err.Description
    Resume Exit_StartOptions_Click

    End Sub


    Thanks. . .

  2. #2
    Join Date
    May 2002
    Location
    London
    Posts
    87
    To close the current form without saving

    Code:
    DoCmd.Close acForm, Me.Name, acSaveNo
    However I found myself hitting this while debugging and losing changes. Thus I have

    Code:
    DoCmd.Close acForm, Me.Name, IIf(AppDebug, acSavePrompt, acSaveNo)
    With
    Code:
    Global Const AppDebug = True
    set until I realease the application.

  3. #3
    Join Date
    Jun 2002
    Location
    Houston, TX
    Posts
    116
    I got it with this:

    DoCmd.Close acForm, Me.Name

    That works beautifully.

    Thanks for you help.

    texasalynn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •