On my tables I have a checkbox control called [closed]. I need a way to automaticly check all the boxes pulled in a query. What this does is lock the record so that it cannot be changed. I am not very good a looping through sets of records and changing the value. In fact I am not sure how to pull a recordset at all in VB. I am pretty sure this needs to be done in VB or a query but how do I change records values in a query? Or how do a pull a record set and loop through it and change the values of this one field? The table name is [tenders] and the field name is [closed]. If some one could give me a loop recordset code to pull and change the value of [closed] to true I sure would appreicate it. I have tryed a button on a form but it will only change the active record not all the records.
Here is the code I have on
Private Sub Command1_Click()
Dim ctl As Control
Do Until Me.[closed] = True
For Each ctl In Me.Form
If [closed].Value = False Then
[closed].Value = True
End If
Next ctl
Loop
End Sub
You can always say tomarrow, but when you say yesterday, today is easier.
RBE
Our prayers go out to the WTC victims
Here is the code I have on
Private Sub Command1_Click()
Dim ctl As Control
Do Until Me.[closed] = True
For Each ctl In Me.Form
If [closed].Value = False Then
[closed].Value = True
End If
Next ctl
Loop
End Sub
You can always say tomarrow, but when you say yesterday, today is easier.
RBE
Our prayers go out to the WTC victims