I have a form that consists of menuitems. I have another form...(also visible) that has a bunch of settings. The user can change these settings and there is a save button to save them. If the user changes the settings and hits the menuitem without first hitting save....I would like to warn him that he will lose any unsaved data. The problem is that the menuitem button is on another form. Plus there are a bunch of menuitems. I would have to trap each button? What is the most efficient way of doing this? I can do it with a bunch of globals but....I just think there gotta be a more efficient way.
Heres what Ive got so far...
public sub cmdMenuItem_Click()
If ChangeSettings.bIsSettingFormLoaded then
If bIsDifferent then
i = iSysMsg(MSG,iX,SetupChange)
'iSysMsg is an error msg generator located in another module. MSG & SetupChange are also constants. iX is a local integer.
'Global Module to hold the changes
bIsDifferent as boolean
bIsSettingFormLoaded as boolean
iMSGNumber as integer
public ChangeSettings as ChangeSettings_Type