Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006

    Arrow Unanswered: disable the close button

    hello .
    i am working on a form . basically its an account form which has a close button on it . as well i have a close button on menu as well . i programmed the form close button so it cannot be closed until both the debits and credits are same. but the one on the menu bar is available that is creating problems . all the close functions shouldnt work until the debits and credits are same.

    secondly i am thinking about is there a way say we select a value from a combo box and when the complete record is entered the combo box is resetted to default or blank for a new record. but i am concerned that the value once clicked in the combo should remain there regardless number of records entered and should only be resetted when the form closes

    any help would be appreciated

  2. #2
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    One way around the close button issue is to use the form's unload event. This will also protect you against someone closing the whole program. The basics are that you have either have a form level variable, a control or something that signifies that it's okay to close the form. In the unload event, you test that and if it's not the appropriate value, set Cancel = True, which will stop the close. In your main close button, after you've validated the data, set that variable/control/whatever appropriately so the close event will be allowed to occur.

  3. #3
    Join Date
    Apr 2006
    There's a previous thread on this with the exact answer you're looking for
    search forums for 'disable msaccess close button' 05-07-06
    Only quitters quit!

Posting Permissions

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