Access 2003: Loop Through Records

  • Thread starter Thread starter eckert1961
  • Start date Start date
E

eckert1961

Hello,

I need some assistance with the following code.

Private Sub GradeAttempting()
If Nz(Forms.Members.Ready, True) = True And Nz(Forms.Members.Active, True) =
True Then
With Forms.Members.GradeAttempting
.SetFocus
.ListIndex = .ListIndex + 1
End With
End If
End Sub

This updates a combobox, "GradeAttempting" on a main form, "Members". This
works but only for the Member page that I have the form open to. To update
the rest of the records I have to manually navigate through all members
pages and
run the code for each page.

What I want is have the code cycle through all of the records and update
GradeAttempting and I also need the checkbox, "Ready", cleared on each page.

What code do I need to add to accomplish this? Thanks.
 
Hi Pieter,

Thank you for taking the time to respond. I believe that I already have what
you've outlined but I'm not sure if I'm implementing it correctly. Currently
the control source for the combobox on my Members form is a field in my
Members table, GradeAttempting. For the row source I'm using the following
query.

SELECT GradeTypes.*, GradeTypes.GradeTypeID, GradeTypes.GradeType FROM
GradeTypes ORDER BY GradeTypes.GradeTypeID, GradeTypes.GradeType DESC;

The table GradeTypes has a field, SortField, which is what you recommended.
As I noted, I'm not sure if my implementation is correct. If not, what
changes would you recommend?

Additionally, would an update query be able to select the next GradeType? If
so, how?
 
Back
Top