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
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.