C
Carl
dear all
I need to create an after event code that will check
previous records based on forgein keys "EMEI ID"
and "Status ID".
If there are duplicates of "EMEI ID" in the table then all
the previous records must be a "Status ID" of 9
(superseded).
If there is a duplicate and the one of the previous
records is not '9' then I need a message box and the field
to revert to the pre update data.
I've got this so far:
Dim strDBconn As Database
Set strDBconn = CurrentDb
Dim strSQL
Dim SupIssue
strSQL = "SELECT [EMEI ID], [Status ID] FROM [EMEI
Detail] WHERE [EMEI ID] = " & Me.emei_id & " AND [Status
ID] <> 9"
Set SupIssue = strDBconn.OpenRecordset(strSQL)
If SupIssue.RecordCount = 0 Then
MsgBox "Supersede the previous issue."
Else
' All OK
End If
I need to create an after event code that will check
previous records based on forgein keys "EMEI ID"
and "Status ID".
If there are duplicates of "EMEI ID" in the table then all
the previous records must be a "Status ID" of 9
(superseded).
If there is a duplicate and the one of the previous
records is not '9' then I need a message box and the field
to revert to the pre update data.
I've got this so far:
Dim strDBconn As Database
Set strDBconn = CurrentDb
Dim strSQL
Dim SupIssue
strSQL = "SELECT [EMEI ID], [Status ID] FROM [EMEI
Detail] WHERE [EMEI ID] = " & Me.emei_id & " AND [Status
ID] <> 9"
Set SupIssue = strDBconn.OpenRecordset(strSQL)
If SupIssue.RecordCount = 0 Then
MsgBox "Supersede the previous issue."
Else
' All OK
End If