Dim rsFiltered As DAO.Recordset
With Me.Recordset
.Filter = "[Active] = True"
Set rsFiltered = .OpenRecordset
End With
With rsFiltered
If .RecordCount <> 0 Then
.MoveFirst
Do Until .EOF
' Do something with each filtered record
.MoveNext
Loop
End If
End With
On Error Resume Next
If Not rsFiltered Is Nothing Then
rsFiltered.Close
Set rsFiltered = Nothing
End If
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter