Hi All,
I'm trying to write a function that looks at two record sets and verify that pack numbers match between RetailEntry and tblTemp. If a pack number is in RetailEntry and not tblTemp then I want it give a warning.
What I have below works for a 1 to 1 check BUT there is the possibility of duplicates and that's where my problem is. As long as the pack number appears between the two tables it's a "Pass" otherwise it's a "Fail" and it stops so it can be corrected in the RetailEntry table.
Any help would be greatly appreciated!
Here is my code currently:
Thanks!!!
-Deke
I'm trying to write a function that looks at two record sets and verify that pack numbers match between RetailEntry and tblTemp. If a pack number is in RetailEntry and not tblTemp then I want it give a warning.
What I have below works for a 1 to 1 check BUT there is the possibility of duplicates and that's where my problem is. As long as the pack number appears between the two tables it's a "Pass" otherwise it's a "Fail" and it stops so it can be corrected in the RetailEntry table.
Any help would be greatly appreciated!
Here is my code currently:
Code:
Function Validation()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim rsm As DAO.Recordset
Set db = CurrentDb
Set rs = CurrentDb.OpenRecordset("RetailEntry")
Set rsm = CurrentDb.OpenRecordset("tblTemp")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Validate offers have not mailed
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Do Until rs.EOF = True
If rsm.RecordCount = 0 Or rs.Fields("Pack_Number") <> rsm.Fields("PackNum") Then
MsgBox ("All prefixes have mailed for Pack Number " & rs.Fields("Pack_Number") & " If you wish to submit an In-season Markdown Request " _
& "please exit the tool, and submit your request using the In-Season Markdown request file in the CID Request folder")
Exit Function
rs.MoveNext
rsm.MoveNext
Loop
End If
End Function
Thanks!!!
-Deke