Results 1 to 5 of 5
  1. #1
    kelkan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26

    open one form from a command button but another if the user clicks 'x' instead.

    I have several forms in my database to guide a user to specific information. Each one of these forms is setup to close the current form and open the new form after a clicking a command button. This works great if the user uses the command buttons throughout; however, when the user closes a form by clicking the 'X', the form closes and nothing is opened. I want the user to use the command buttons and navigate the database that way. Is it possible to setup a message box to open if the user clicks the 'x' instead of the command button? I tried the on close event but I want the form to close if the command button is selected and the intended form to then open. suggestions?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Why not just hide the X? If you want to leave it, you're probably looking at a form level variable and the unload event, which can be cancelled.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kelkan is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2012
    Posts
    26
    how do you hide the x?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Look at the properties of the form. On the format tab if memory serves.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes, it is the CloseButton property on Format tab - set it to No. The X won't go away but it will be disabled. Have you also disabled the right click shortcut menu?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 8
    Last Post: 06-25-2014, 08:03 AM
  2. Open Form or Command Button problem
    By geordie_taz in forum Forms
    Replies: 3
    Last Post: 12-13-2012, 10:09 AM
  3. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  4. How to not add Record if User clicks a BUTTON
    By taimysho0 in forum Programming
    Replies: 7
    Last Post: 12-06-2011, 10:49 AM
  5. Use a command button to open a form
    By johnpaul in forum Forms
    Replies: 24
    Last Post: 09-23-2010, 12:29 PM

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