I ask for help with the following:
I have a DB with 1 Main Menu through which I access other forms: formEditProduct and formAddProduct. My problem is that when I access formEditProduct and make modifications without saving when I press the "cancel" option the macro opens the "Main Menu" and leaves open The active form.
Can someone guide me as I should adjust the code so that by pressing "cancel" do not open the "Main Menu"?
Here is the code associated with the "Exit" button:
Code: Select all
Sub CloseFormEditProduct
Dim Opcion As Integer
Opcion = MsgBox ("Do you really want to go out?", 36, "Choose an option!")
If Opcion = 6 Then
ThisDataBaseDocument.FormDocuments.GetByName("formEditProduct").Close
const sNewDocumentName="Main Menu"
oNewFormDocument=ThisDataBaseDocument.FormDocuments.getbyname(sNewDocumentName).open
End If
If opcion = 2 Then
End If
End Sub
prueba.odb
Thank you.