Any thoughts on why this code does not do its stuff.
Using BPDATE as 05/04/2003 then any movedate where types = died between 06/04/2003 and 10/06/2003 should return the msgbox I think !! but it does`nt
Private Sub tag_combo_AfterUpdate()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM Beefpremdate WHERE(((Beefpremdate.[BPDATe])> (" & DateAdd("d", -65, movDate) & " )) AND ((Beefpremdate.[Record No])= " & [Forms]![Movement Form 2]![Tag combo].Column(3) & "))")
If Types = "DIED" Then
If Not (rst.BOF) Then
MsgBox "THIS ANIMAL MAY BE IN BEEF PREMIUM RETENTION. CHECK YOUR RECORDS AND CONTACT DEFRA WITHIN 10 DAYS IF IT IS."
Else
If (rst.BOF) Then
Exit Sub
End If
End If
End If
Set dbs = Nothing
Set rst = Nothing
Exit Sub
End Sub
TIA
David B
Using BPDATE as 05/04/2003 then any movedate where types = died between 06/04/2003 and 10/06/2003 should return the msgbox I think !! but it does`nt
Private Sub tag_combo_AfterUpdate()
Dim dbs As Database
Dim rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM Beefpremdate WHERE(((Beefpremdate.[BPDATe])> (" & DateAdd("d", -65, movDate) & " )) AND ((Beefpremdate.[Record No])= " & [Forms]![Movement Form 2]![Tag combo].Column(3) & "))")
If Types = "DIED" Then
If Not (rst.BOF) Then
MsgBox "THIS ANIMAL MAY BE IN BEEF PREMIUM RETENTION. CHECK YOUR RECORDS AND CONTACT DEFRA WITHIN 10 DAYS IF IT IS."
Else
If (rst.BOF) Then
Exit Sub
End If
End If
End If
Set dbs = Nothing
Set rst = Nothing
Exit Sub
End Sub
TIA
David B