Loop thru records in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table called files and it has 2 fields, a namefield and a yes no
field, What I would like to know is how can I get a piece of code that will
loop thru each record and check if the yes\no field is true.

If true I want it to carry out an action

Thanks
 
there are a plenty examples in help:
dim rstOutput as dao.recordset
set rstOutput=currentdb.opendrecordset("files",dbopentable)
With rstOutput
Do While Not .EOF
if .Fields(1) then
'do action
end if
.MoveNext
Loop
End With
rstOutput.close
 
What I would like to know is how can I get a piece of code that will
loop thru each record and check if the yes\no field is true.

It's nearly always faster, easier and more robust to do it all in a SQL
command... what do want to do with the records you find?

B Wishes


Tim F
 
Back
Top