P.S. var_epice_txt est mon controle du formulaire parent du bouton
commande11 qui contient une donn�e d'un autre sous-formulaire
Private Sub Commande11_Click()
Dim stDocName As String
Dim var_no_lot As Variant
Dim mycheck As Variant
Dim test As Integer
Dim var_epice As String
If IsNull(Me.Parent.var_epice_txt) Then
var_epice = ""
Else
var_epice = Me.Parent.var_epice_txt (MON ERREUR SE SITUE ICI)
End If
var_no_lot = Me.Parent.no_lot_inventaire
mycheck = IsNull(var_no_lot)
test = DCount("*", "R_epice_diff", "type_epice")
If test > 1 Then
MsgBox "Vous avez plusieurs type d'�pice de s�lectionn� et vous
devez mettre seulement 1 seule �pice dans un inventaire. Cr�ez un nouvel
inventaire ou s�lectionner d'autres r�cipients. D�COCHEZ TOUS LES
R�CIPIENTS DIFF�RENTS DE L'�PICE � INVENTORIER"
Cancel = True
Else
test = DCount("*", "R_epice_diff", "type_epice='" & var_epice & "'")
If test = 0 Then
MsgBox "L'�pice que vous voulez rajouter � cet inventaire est
diff�rente de celle qui est d�j� pr�sente. Veuillez s�lectionner un autre
r�cipient ou vous cr�ez un autre inventaire. D�COCHEZ TOUS LES R�CIPIENTS
DIFF�RENTS DE L'�PICE � INVENTORIER"
Cancel = True
Else
If mycheck = -1 Then
MsgBox "Veuillez s�lectionner une date."
Cancel = True
Else
DoCmd.SetWarnings (False)
Refresh
stDocName = "R_maj_mis_en_inv_t_sechage"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "R_maj_no_inv"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Refresh
DoCmd.SetWarnings (True)
Requery
End If
End If
End If
End Sub
merci
merci
"Macgiver" <bab...@yahoo.ca> a �crit dans le message de news:
e1a7KMPp...@TK2MSFTNGP02.phx.gbl...