Bonjour,
J'ai une table Portables avec NrInventaire, NrSerie, Marque, etc
J'ai un form avec le nom Portables
Je voudrais éviter la duplication du NrSerie et j'ai créé, dans le form
Portables une text box Text1 avec la commande DLookUp.
J'ai essayé ces 4 options et j'au toujours "Erreur"
=DLookUp("[NrSerie]";"Portables";"[NrInventaire] =" &
Forms!Portables!NrInventaire)
=DLookUp("[NrSerie]";"Portables";"[NrInventaire] =" & Forms!Portables!NrSerie)
=DLookUp("[NrInventaire]";"Portables";"[NrSerie] =" &
Forms!Portables!NrInventaire)
=DLookUp("[NrInventaire]";"Portables";"[NrSerie] =" & Forms!Portables!NrSerie)
Private Sub NrSerie_BeforeUpdate(Cancel As Integer)
' If DCount("*", "Portables", "NrSerie =" & Me.NrSerie.Value) > 0 Then
MsgBox "Le n° " & NrSerie & " est déjà attribué au : " & Chr(13) &
Chr(13) & Text1, vbExclamation, "Numéro de Série"
Me.Undo
Cancel = True
' End If
End Sub
De l'aide, s.v.p.
Merci d'avance
A Costa