Results 1 to 5 of 5

Thread: ACCESS: Emulate Title Bar "X" Close Button ???

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Question ACCESS: Emulate Title Bar "X" Close Button ???

    Esteemed Forum Participants and Lurkers:

    Access 97 vba

    We are trying to install a "Submit" button on a user input form and we need to close the form from the "click" event handler. In my vba code module, how can I close an Access Form so that it closes EXACTLY the same way it closes when the Title Bar "X" Close button is clicked?

    I've tried "DoCmd.Close", but if there are any empty "Required" fields, it does NOT pop up any warning messages (the Title Bar "Close" does), and it does NOT update the record. How can I call or exactly emulate the Title Bar "X" Close button handler?

    Thank you for your comments, suggestions, and assistance.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Hi,

    I think there were some extra parameters to the docmd.close


    Something like:
    VB Code:
    1. DoCmd.Close acForm, Me.Name, acSavePrompt

    Read the helpfiles for more info...


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045
    Vince:

    Thank you for trying. I started this exercise by looking in the Access Help Heap ... what a joke. I also did a search in this forum, but didn't find anything relevant. I tried your suggested "DoCmd" but that didn't alert for missing fields either. I even bought "Access 2003 Power Programming with VBA", but that isn't doing any good either.

    My only recourse right now is to scan all of the required controls and pop up messages if any of them are empty/illegal. I would much rather call the handler for the Title Bar Close button, or throw an event for that button.

    Maybe I'll get lucky and someone on this forum will know how to do it.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Just read the help file part on the 2000. It states that there will be no error msg and that you have to check those fields that are required manually (via code insull function ...) and alert the user (example was given on the help page).

    Or you could forget it, cause if they close it doesn't save anyway (unless you mean it to, in which case why are the users closing the form instead of clicking save?).

    Doesn't look like its possible to replicate the close button on the form, its built in via MS.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045
    Originally posted by Ecniv
    Just read the help file part on the 2000. It states that there will be no error msg and that you have to check those fields that are required manually (via code insull function ...) and alert the user (example was given on the help page).
    ??? I don't know where you found this ... I only have Access 97.

    Or you could forget it, cause if they close it doesn't save anyway (unless you mean it to, in which case why are the users closing the form instead of clicking save?).
    We are modifying an existing application. There has been a lot of confusion by new users over how to "save" their request when they have completed the form. Clicking the "X" Close button in the title bar is NOT the normal "Windows" way of "saving" one's work. We are adding a "Submit" button to clear up the confusion. Users would then be able to either click the new "Submit" button or close the form window. If they do click the "Submit" button and the form closes but it really doesn't do anything it will cause MAJOR problems.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

Posting Permissions

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



Click Here to Expand Forum to Full Width