• Close button on a form (access 2003)

    Author
    Topic
    #455764

    Hi all,

    I have created a close form button on one of my access forms but when I click on the button I get the following error(see the attached file)
    Many thanks for your help

    Viewing 0 reply threads
    Author
    Replies
    • #1135883

      Skender,

      Did you use the wizard to create the button, or did you write the VBA yourself? Right click on the button, and go to properties. Go to the ‘event’ tab, and select the ‘on click’ event. Click the three dots to the right. It should look something like

      Private Sub CloseButton_Click()
      DoCmd.Close
      End Sub

      • #1137073

        I did use the wizard and I also created the button manually and I still get the same problem.

        Cheers

        • #1137076

          What is the code you used? You really only need 1 line of code behind the button:

          DoCmd.Close

          • #1137740

            There was something wrong with the form I guess, I have created a new form and also the close button, all working fine now….

            Cheers for your help.

    Viewing 0 reply threads
    Reply To: Close button on a form (access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: