Hi all,
Could you please give me some suggestions about Form closing? My problem is that I will do the checking before closing the main Form whether the user saves the data, but I really don't know how to solve it.
If the user doesn't save the data and close the Form, it will show a message and the main Form should be still there. That will not be closed.
I will show you my sample code.
Dim bStop As Boolean
Private Sub Command1_Click()
bStop = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
If bStop = False Then
MsgBox "Don't close the Form and save the data first."
Exit Sub
Else
MsgBox "Close the Form"
End If
End Sub
Pls give me a hand.
Thanks,
zawpai