Results 1 to 5 of 5
  1. #1
    acampbell is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    3

    HELP with close form button

    I upgraded a database from Access 2002 to Access 2010 and I am getting this error when using a close button that existed in the old format:



    Click image for larger version. 

Name:	access.PNG 
Views:	11 
Size:	22.9 KB 
ID:	27102


    When I debug, this is what I get:

    Click image for larger version. 

Name:	access2.PNG 
Views:	11 
Size:	31.8 KB 
ID:	27103

    Any ideas what the problem is or how to fix it? I'm new to access and learning as I go and cannot figure this one out.
    Attached Thumbnails Attached Thumbnails access.png  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if the form is closing, theres no need to enable/disable items.
    they will not exist in 1 second.
    If you are enabling items in ANOTHER form, then use the full path, forms!myForm!btnFilter.enabled = false

  3. #3
    acampbell is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    3
    So if it's not enabling items in another form then what would I do to fix it?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    At first I figured that you imported the old objects into a new database file as opposed to doing a Save As but you left out the custom menu or toolbar being referenced. However, it probably would have choked on the line that sets the btnFilter object if that was the case. I can imagine why you're trying to manipulate commandbar objects before a form closes, but not in the form close event if that custom menu is tied to that form somehow. I would have coded it in the Unload event. Maybe it worked before because it was closing slower than it is now?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    acampbell is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2017
    Posts
    3
    I just removed that section and it seems to be working fine now. Thanks for the help.

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

Similar Threads

  1. If number then set close button on form to false
    By Ruegen in forum Programming
    Replies: 6
    Last Post: 10-20-2013, 09:09 PM
  2. Close Form button not working
    By RedGoneWILD in forum Forms
    Replies: 2
    Last Post: 06-25-2012, 07:02 AM
  3. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  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