Find Criteria in Table
Hi All,
I am working on searching, checking PID field in table1 if match with table2 then start doing add or updation but somehow it not matching condition
Any help...
r.Open "Table1", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
t.Open "Table2", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Do While Not r.EOF
Criteria = "[PID]='" & r!f1 & "' "
t.Find Criteria
If t.EOF Then
If Nz(r!f1, "") <> "" And Nz(r!f2, "") <> "" And Nz(r!f4, "") <> "" And r!f2 >= 1 Then
t.AddNew
t!PID = r!f1
t.Update
Else
' Show Error
End If
Else
If Nz(r!f1, "") <> "" And Nz(r!f2, "") <> "" And Nz(r!f4, "") <> "" And r!f2 >= 1 And Not t.EOF Then
t!PID = r!f1
t.Update
Else
'error
End If
End If
r.movenext
Loop
|