A
AJOLSON
This is my first venture down looping through record set and I am not really
sure of how it is done. But here is what I am trying to do. I have a query
where if a condition is me in one of the fields I want the field to backcolor
to turn to Vbred.
I have a query Named, TermType_Counts_Final and within that query I have a
field named OFF that return yes or no.
What I want is if the value is -1 “yesâ€, I want the backdrop to be vbred.
Below is the code I am using and what it is producing is that all values in
the filed “OFF†are coming back with a backcolor of vbred
Am I even on the right track?
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("TermType_Counts_Final", dbOpenDynaset)
Do While Not rst.EOF
If rst![OFF] <> 0 Then 'The real loop exit condition.
Me.OFF.BackColor = vbRed
End If
rst.MoveNext
Loop
Any help would be greatly appreciated
Andy
sure of how it is done. But here is what I am trying to do. I have a query
where if a condition is me in one of the fields I want the field to backcolor
to turn to Vbred.
I have a query Named, TermType_Counts_Final and within that query I have a
field named OFF that return yes or no.
What I want is if the value is -1 “yesâ€, I want the backdrop to be vbred.
Below is the code I am using and what it is producing is that all values in
the filed “OFF†are coming back with a backcolor of vbred
Am I even on the right track?
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("TermType_Counts_Final", dbOpenDynaset)
Do While Not rst.EOF
If rst![OFF] <> 0 Then 'The real loop exit condition.
Me.OFF.BackColor = vbRed
End If
rst.MoveNext
Loop
Any help would be greatly appreciated
Andy