Hi
If I put in an ack number and it is a duplicate, I want to delete the number and continue on.. but I get an error message and it says "Invalid use of Null" end or debug etc....
How do I get my code to allow me to delete numbers and continue on.. or allow the null field? I.e. allow record to have a blank ack number
here is my code on the field .. which works (apart from when I want to erase the ack number after finding it is a duplicate)
Private Sub Ack_No_BeforeUpdate(Cancel As Integer)
'*********************************
'TO CHECK FOR DUPLICATES
'*********************************
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.Ack_No.Value
stLinkCriteria = "[Ack_No]=" & "'" & SID & "'"
'Check CALL LOG table for duplicate ACK NO
If DCount("Ack_No", "CALL LOG", stLinkCriteria) > 0 Then
'Message box warning of duplication
MsgBox "WARNING!! Duplicate Acknowledgement Number! " _
& SID & " this number has already been entered." _
& vbCr & vbCr & "Please mark this a 2nd/3rd etc. replacement.", vbInformation _
, "Duplicate Information"
End If
Set rsc = Nothing
End Sub
If I put in an ack number and it is a duplicate, I want to delete the number and continue on.. but I get an error message and it says "Invalid use of Null" end or debug etc....
How do I get my code to allow me to delete numbers and continue on.. or allow the null field? I.e. allow record to have a blank ack number
here is my code on the field .. which works (apart from when I want to erase the ack number after finding it is a duplicate)
Private Sub Ack_No_BeforeUpdate(Cancel As Integer)
'*********************************
'TO CHECK FOR DUPLICATES
'*********************************
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
SID = Me.Ack_No.Value
stLinkCriteria = "[Ack_No]=" & "'" & SID & "'"
'Check CALL LOG table for duplicate ACK NO
If DCount("Ack_No", "CALL LOG", stLinkCriteria) > 0 Then
'Message box warning of duplication
MsgBox "WARNING!! Duplicate Acknowledgement Number! " _
& SID & " this number has already been entered." _
& vbCr & vbCr & "Please mark this a 2nd/3rd etc. replacement.", vbInformation _
, "Duplicate Information"
End If
Set rsc = Nothing
End Sub