Hi All
I want to make a code which is used to compare two tables data and difference add in third table called result.but I could not complete it sucesscessfuly Please check the problem.


Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset


rs.Open "select * from texcel", con

rs2.Open "select * from result", con, adOpenDynamic, adLockOptimistic





Do While Not rs.EOF
rs1.Open "select * from WMS where category='" & rs!category & "' and item='" & rs!Item & "'", con

If rs1.RecordCount = 0 Then

rs2.AddNew
rs2!category = rs!category
rs2!Item = rs!Item
rs2!remarks = "Item not found in WMS"
rs2.Update

End If


rs1.Close

rs.MoveNext

Loop

MsgBox "Data Matching is complete", vbInformation + vbOKOnly, "Jafri Soft"