Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Close button on a form (access 2003)

    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
    Attached Files Attached Files

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Close button on a form (access 2003)

    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
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  3. #3
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Close button on a form (access 2003)

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

    Cheers

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Close button on a form (access 2003)

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

    DoCmd.Close
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    4 Star Lounger
    Join Date
    Aug 2005
    Location
    London/Kingston, Surrey, United Kingdom
    Posts
    518
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Close button on a form (access 2003)

    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.

Posting Permissions

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