A
apna
I'm trying to process a table like this:
read all records in table, process field1, write results to a new table.
then
read all records in table, process field2, write results to the new table.
then
etc, etc, etc. (note the field is changing each time.)
My code so far is this:
Private Sub readrecordset()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("results")
rst.MoveFirst
Do While Not rst.EOF
If rst!Q01 = 1 Then
BossSigS = BossSigS + 1
BossSigC = BossSigC + 1
OtherS = OtherS + 1
OtherC = OtherC + 1
End If
If rst!Q01 = 2 Then
BossSomS = BossSomS + 2
BossSomC = BossSomC + 1
OtherS = OtherS + 1
OtherC = OtherC + 1
End If
rst.MoveNext
Loop
So after the Loop I need to move to the next field (Q02) and then reread all
of the records again. I can reread the records but how can I make rst!Q01
change to rst!Q02 and so forth rst!Q03......rst!Q04......all the way to
question 56: rst!Q56?
thanks
read all records in table, process field1, write results to a new table.
then
read all records in table, process field2, write results to the new table.
then
etc, etc, etc. (note the field is changing each time.)
My code so far is this:
Private Sub readrecordset()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("results")
rst.MoveFirst
Do While Not rst.EOF
If rst!Q01 = 1 Then
BossSigS = BossSigS + 1
BossSigC = BossSigC + 1
OtherS = OtherS + 1
OtherC = OtherC + 1
End If
If rst!Q01 = 2 Then
BossSomS = BossSomS + 2
BossSomC = BossSomC + 1
OtherS = OtherS + 1
OtherC = OtherC + 1
End If
rst.MoveNext
Loop
So after the Loop I need to move to the next field (Q02) and then reread all
of the records again. I can reread the records but how can I make rst!Q01
change to rst!Q02 and so forth rst!Q03......rst!Q04......all the way to
question 56: rst!Q56?
thanks