T
TeeSee
I'm Using Sandra Daigles code to loop through and make a change to all
records in a table. The field in the table "Select" is a Yes/No data
type. It changes only the current record in my form. Here is the code.
Any suggestion welcomed.
Private Sub cmdDeSelect_Click()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb()
'Change this to your SQL or to the name of a saved query
Set rst = db.OpenRecordset("Select * from tblCDMRvalues;")
With rst
' Very important to avoid errors if no records are returned
If Not (.EOF And .BOF) Then
'movefirst isn't strictly necessary - but just in case
.MoveFirst
Do Until .EOF
'do something with record
Me.Select.Value = 0
.MoveNext
Loop
End If
.Close
End With
Set rst = Nothing
Set db = Nothing
End Sub
records in a table. The field in the table "Select" is a Yes/No data
type. It changes only the current record in my form. Here is the code.
Any suggestion welcomed.
Private Sub cmdDeSelect_Click()
Dim rst As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb()
'Change this to your SQL or to the name of a saved query
Set rst = db.OpenRecordset("Select * from tblCDMRvalues;")
With rst
' Very important to avoid errors if no records are returned
If Not (.EOF And .BOF) Then
'movefirst isn't strictly necessary - but just in case
.MoveFirst
Do Until .EOF
'do something with record
Me.Select.Value = 0
.MoveNext
Loop
End If
.Close
End With
Set rst = Nothing
Set db = Nothing
End Sub