G
Guest
Any can help me to correct my coding ?
**********************************************
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Dim strSelect2 As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM table1"
strSelect2 = "Select * FROM table2"
Set rst = dbs.OpenRecordset(strSelect)
Set rst2 = dbs.OpenRecordset(strSelect2)
Do While Not rst.EOF
rst.Edit
rst2.Edit
If rst![Item] = rst2![Item] Then
rst2![Result] = rst2![P1ST] - rst![Qty]
Else
rst2![Result] = "NOT OK"
End If
rst.Update
rst2.Update
rst.MoveNext
rst2.MoveNext
Loop
rst.close
rst2.close
MsgBox (" compare Done!!!")
End Sub
***************************************
Pls help me
**********************************************
Dim dbs As Database, rst As Recordset
Dim strSelect As String
Dim strSelect2 As String
Set dbs = CurrentDb
strSelect = "SELECT * FROM table1"
strSelect2 = "Select * FROM table2"
Set rst = dbs.OpenRecordset(strSelect)
Set rst2 = dbs.OpenRecordset(strSelect2)
Do While Not rst.EOF
rst.Edit
rst2.Edit
If rst![Item] = rst2![Item] Then
rst2![Result] = rst2![P1ST] - rst![Qty]
Else
rst2![Result] = "NOT OK"
End If
rst.Update
rst2.Update
rst.MoveNext
rst2.MoveNext
Loop
rst.close
rst2.close
MsgBox (" compare Done!!!")
End Sub
***************************************
Pls help me