There is my code. The only thing that I would like to do is to display a field jointed to the same table of the packet_number. Everything is on a subform and I use Access2000. This field that I want to display is not the only one in the table but it's the only one that I want to display in my subform.
Thanks a lot!!
Private Sub packet_number_BeforeUpdate()
Dim condition As String
condition = "[packet_number]='" & Me! [packet_number] & "'"
If DLookup ("[packet_number]", "table_name",condition) <> "" Then
MsgBox "this number exist"
Else
MsgBox "This number doesn't exit"
DoCmd.CancelEvent
End If
End Sub
Thanks a lot!!
Private Sub packet_number_BeforeUpdate()
Dim condition As String
condition = "[packet_number]='" & Me! [packet_number] & "'"
If DLookup ("[packet_number]", "table_name",condition) <> "" Then
MsgBox "this number exist"
Else
MsgBox "This number doesn't exit"
DoCmd.CancelEvent
End If
End Sub