Question : Access 2010 VBA - determining which "Yes/No" boxes are checked on a continupus form

Hi

I have a continuous 2010 Access form and want to use VBA code to find which records contain
"Yes" for a "Yes/No" field.

Thanks

Answer : Access 2010 VBA - determining which "Yes/No" boxes are checked on a continupus form

to put the IDs into an array...(untested code)

dim db as database
Dim rs as dao.recordset
Dim MyIds as variant
set db = currentdb
set rs = db.openrecordset("Select ID from tablename where yesnofield = true")
myIds = rs.GetRows(1000000) ' any number more than the max number you might get
rs.close
set rs= nothing
set db = nothing
' you now have an array of ids in MyIDs - for testing use the next line to show how many
msgbox ubound(myids)+1  '


Random Solutions  
 
programming4us programming4us