Finding records and printing reports-HELP!

  • Thread starter Thread starter alb_7896
  • Start date Start date
A

alb_7896

Guest
I am finishing up a database and need help with the last step. Using Access 2000 and VB 6.0, I need to search for records in the access db with a checked box. The problem is that this search needs to locate the first record with a checkmark in a sorted section and then print every record only from that point on and then start the search over with the next sorted section. Then, all the check marks need to be reset. Please email me if any suggestions.
 
have u tried using recordsets and a for..next loop??

i've done something similar using code something like this

with rst
'where rst are the checked records you want to compare

.movefirst
do until rst.eof
varCompare = ![CheckedField]
with rst2 - where rst2 are the records you want to compare to the checked field
for i = 1 .. .recordcount
if ![CompareField] = varcompare then
do code
end if
.movenext
next i
end with 'for rst2
.movenext 'for rst
loop
end with 'for rst

if rst and rst2 are the same table you can use a bookmark

with rst
'where rst are the checked records you want to compare
.movefirst
do until rst.eof
varCompare = ![CheckedField]
varBookmark = .bookmark
.movefirst
for i = 1 .. .recordcount
if ![CompareField] = varcompare then
do code
end if
.movenext
next i
.bookmark = varBookmark
.movenext
loop
end with 'for rst

this way you can increment to the next record you want to be the !checkedfield without starting at the top again, which is what you would have to do b/c you went thru the entire table already looking at the !CompareField

Sorry if this is confusing - but i hope it helps.

- Topher
 

Users who are viewing this thread

Back
Top Bottom