I want to select several records (or rows) with the same cell value in column 1 and put them in a combobox. What can I do best? Filter the sheet for these rows (A)? Or use Find and then AddItem within a loop (B)?
(A) 'filter on brand which is first column
strFilter = "Brand = " & strBrandSelected
rsToplease.Filter = strFilter
'fill combobox
Do Until rsToplease.EOF
varTypeSelection = rsToplease!Type
'Type is 2nd column
cboType.AddItem varTypeSelection
rsToplease.MoveNext
Loop
'close filter
rsToplease.Filter = ""
(A)>>> Run-time error '91'
Object variable of With block variable not set
(B) strFind = "Brand = " & strBrandSelected
Do Until rsToplease.EOF
rsToplease.Find strFind
varTypeSelection = rsToplease!Type
cboType.AddItem varTypeSelection
Loop
(B)>>>Compile error, Method or datamendber not found
John Wijen
(A) 'filter on brand which is first column
strFilter = "Brand = " & strBrandSelected
rsToplease.Filter = strFilter
'fill combobox
Do Until rsToplease.EOF
varTypeSelection = rsToplease!Type
'Type is 2nd column
cboType.AddItem varTypeSelection
rsToplease.MoveNext
Loop
'close filter
rsToplease.Filter = ""
(A)>>> Run-time error '91'
Object variable of With block variable not set
(B) strFind = "Brand = " & strBrandSelected
Do Until rsToplease.EOF
rsToplease.Find strFind
varTypeSelection = rsToplease!Type
cboType.AddItem varTypeSelection
Loop
(B)>>>Compile error, Method or datamendber not found
John Wijen