I am trying to write code to populate the 'correct data' column. I know how to check if the data is correct but I cant figure out how to return text for each individual record in the 'correct data' column. I want to have the module run and return 'yes' or 'no' in the correct records but it will only return, I believe, the last answer I would be returning. Is there a way to parse through the column like the .movenext operator in recordsets?
Thanks a bunch!
Code:
Function joeshmo() As String
Dim db As Database
Dim Orig As DAO.Recordset
Dim Ltr As DAO.Recordset
Dim checker As Boolean
Set db = CurrentDb()
Set Orig = db.OpenRecordset("select OriginalMult from Small")
Set Ltr = db.OpenRecordset("select LetterCode from Small")
Orig.MoveFirst
With Ltr
While Not Orig.EOF
.MoveFirst
checker = False
While Not .EOF
If Orig("OriginalMult") = Ltr("LetterCode") Then
joeshmo = "yes" 'This is where im trying to do it
checker = True
.MoveLast
Else
.MoveNext
End If
Wend
If checker = False Then
joeshmo = "no" 'this is the option for no
End If
Orig.MoveNext
Wend
End With
Orig.Close
Ltr.Close
End Function