C
Chris
Hi
How can I stop the action close form
When the user close the form I'm asking him if he want to
close or no and when he said no (I don't want to close
the form) the action close form will stop and the form
will stay loaded at screen
Can I do that
This is the code I'm using:
Private Sub Form_Close()
If (Me.Item) = 0 And IsNull(Me.CoulorA) And IsNull
(Me.CoulorB) And IsNull(Me.CouleurC) Then
If MsgBox("Are you sure to quit the form without
adding a command", vbExclamation + vbYesNo) = vbYes Then
DoCmd.SetWarnings True
DoCmd.RunSQL "DELETE * FROM Tb_commande WHERE
CommandeID = " & Me.CommandeID
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
Forms!FrmCommande!SbFrm_Commande.Requery
Else
---------------WHAT CAN I ADD HERE TO STOP THE
UNLOAD OF THE FORM
End If
End If
End Sub
How can I stop the action close form
When the user close the form I'm asking him if he want to
close or no and when he said no (I don't want to close
the form) the action close form will stop and the form
will stay loaded at screen
Can I do that
This is the code I'm using:
Private Sub Form_Close()
If (Me.Item) = 0 And IsNull(Me.CoulorA) And IsNull
(Me.CoulorB) And IsNull(Me.CouleurC) Then
If MsgBox("Are you sure to quit the form without
adding a command", vbExclamation + vbYesNo) = vbYes Then
DoCmd.SetWarnings True
DoCmd.RunSQL "DELETE * FROM Tb_commande WHERE
CommandeID = " & Me.CommandeID
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
Forms!FrmCommande!SbFrm_Commande.Requery
Else
---------------WHAT CAN I ADD HERE TO STOP THE
UNLOAD OF THE FORM
End If
End If
End Sub