SAMS
Oct 18th, 1999, 03:34 PM
Hi, guys. As per below is some code which i had encounter problem with. Adodc2 did not select only those claim that have the same code(from text70) but selected all the records from the table (claim). Is it something wrong with the loop?? Pls suggest. Thks.
Adodc9.Recordset.MoveLast
Text71 = Adodc9.Recordset.RecordCount
Adodc9.Recordset.MoveFirst
Static qwAttemp As Integer
Do While (qwAttemp < Text71)
Dim dbs As Database
Set dbs = OpenDatabase("c:\p1\data.mdb")
dbs.Execute "INSERT INTO " & Text70.Text & " SELECT er.* From er"
MsgBox "Update " & Text70.Text & " Done", vbOKOnly, "Update Condition"
dbs.Close
Dim str as string
str = " Select * from '" & Text70.Text & "'"
Data3.RecordSource = str
Data3.Refresh
(Error "incomplete query")
(Ask recordset to find the specific data from text70)
Adodc2.RecordSource = "select * from claim where claim.hpcode = '" & Text70.Text & "'"
Adodc2.Refresh
Do While (Adodc2.Recordset.EOF = False)
Data3.Recordset.AddNew
Data3.Recordset.Fields(0) = 1
Data3.Recordset.Fields(1) = text4
Data3.Recordset.Fields(2) = 1
Data3.Recordset.Fields(3) = text6
Data3.Recordset.Update
Adodc2.Recordset.MoveNext
Loop
MsgBox " '" & Text70.Text & "' checked", vbOKOnly, "BONS checked"
Adodc9.Recordset.MoveNext
qwAttemp = qwAttemp + 1
Loop
Any advice will be appeaciated
[This message has been edited by SAMS (edited 10-19-1999).]
Adodc9.Recordset.MoveLast
Text71 = Adodc9.Recordset.RecordCount
Adodc9.Recordset.MoveFirst
Static qwAttemp As Integer
Do While (qwAttemp < Text71)
Dim dbs As Database
Set dbs = OpenDatabase("c:\p1\data.mdb")
dbs.Execute "INSERT INTO " & Text70.Text & " SELECT er.* From er"
MsgBox "Update " & Text70.Text & " Done", vbOKOnly, "Update Condition"
dbs.Close
Dim str as string
str = " Select * from '" & Text70.Text & "'"
Data3.RecordSource = str
Data3.Refresh
(Error "incomplete query")
(Ask recordset to find the specific data from text70)
Adodc2.RecordSource = "select * from claim where claim.hpcode = '" & Text70.Text & "'"
Adodc2.Refresh
Do While (Adodc2.Recordset.EOF = False)
Data3.Recordset.AddNew
Data3.Recordset.Fields(0) = 1
Data3.Recordset.Fields(1) = text4
Data3.Recordset.Fields(2) = 1
Data3.Recordset.Fields(3) = text6
Data3.Recordset.Update
Adodc2.Recordset.MoveNext
Loop
MsgBox " '" & Text70.Text & "' checked", vbOKOnly, "BONS checked"
Adodc9.Recordset.MoveNext
qwAttemp = qwAttemp + 1
Loop
Any advice will be appeaciated
[This message has been edited by SAMS (edited 10-19-1999).]