S
Stefan
Here is my code
Set db = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "tbl_McareDX", db, adOpenDynamic, adLockOptimistic, adCmdTable
'rs.Find "rs.fields.item("DX")= Diagnosis"
rs.MoveFirst
Do While Not rs.EOF
If Diagnosis = rs.Fields.Item("DX") Then Approval = "YES"
If Diagnosis = rs.Fields.Item("DX") Then Exit Do
If Diagnosis <> rs.Fields.Item("DX") Then Approval = "NO"
rs.MoveNext
Loop
Me!approved = Approval
Basically I am trying to have an unbound text box on a report print YES if
the variable Diagnosis is contained within one of the records of the DX field
of tbl_McareDX
Currently it is always returning NO unless the Diagnosis matches the last
record in DX field
I tried using the find statement commented out above and using the nomatch
property but I keep getting an error.
Any help would be greatly appreciated.
Set db = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "tbl_McareDX", db, adOpenDynamic, adLockOptimistic, adCmdTable
'rs.Find "rs.fields.item("DX")= Diagnosis"
rs.MoveFirst
Do While Not rs.EOF
If Diagnosis = rs.Fields.Item("DX") Then Approval = "YES"
If Diagnosis = rs.Fields.Item("DX") Then Exit Do
If Diagnosis <> rs.Fields.Item("DX") Then Approval = "NO"
rs.MoveNext
Loop
Me!approved = Approval
Basically I am trying to have an unbound text box on a report print YES if
the variable Diagnosis is contained within one of the records of the DX field
of tbl_McareDX
Currently it is always returning NO unless the Diagnosis matches the last
record in DX field
I tried using the find statement commented out above and using the nomatch
property but I keep getting an error.
Any help would be greatly appreciated.