bonjour,
je veut fermer un formulaire (en cours) de vba, j'utilise donc le code
DoCmd.Close acForm, Me.Name, acSaveNo
mais ô malheur un message d'erreur :
"impossible d'executer cette action pdt le traitement d'un evenement de formulaire ou d'état"
or ca marche dans d'autre formulaire dc ca vient peut etre d'une inciherence de mon code:
If txt_num <> "" And IsNull(txt_num) = False Then
If txt_num = "modif" Or txt_num = "nc" Or txt_num = "labo" Then
lbl_nlot.Visible = True
txt_nlot.Visible = True
txt_nlot.SetFocus
txt_nlot.Locked = False
txt_num.Locked = False
If txt_num = "nc" Then lbl_mod.Caption = "nombre de nc par type de défaut"
If txt_num = "labo" Then Txt_mod = "-1"
'MsgBox ("bcle")
Else
txt_nlot = "0"
Txt_mod = "0"
flash_sortp txt_num, txt_nlot, Txt_mod
'MsgBox ("procedure executée flash sur txt_num_lot") '
DoCmd.Close acForm, Me.Name, acSaveNo 'la ca plante
End If
End If
End Sub
help please!
Partager