Reputation: 11205
I have a form that is bound to a table that holds data on projects. There are several statuses that the project can be in:
New
In Progress
On Hold
Complete
Cancelled
Progressed
The first 3 are "Open", the later 3 are "Closed"
I would like to be able to add some navigation buttons (next/prev) that look for the next/prev record based on a drop down that contains "Open", "Closed" and "All". Only records that meet this criteria will appear when using the navigation.
Is this possible? If so, how?
Upvotes: 0
Views: 591
Reputation: 121
SOLUTION 1
The easiest solution is to make a filter, as suggested by JohnHC. You can use a combobox in which you select "Open", "Close", "All".
By selecting a value in the combo (or listbox) you can set the filter (e.g. "Open" --> Status = "New" OR Status = "In Progress" OR Status = "Hold").
The filtering can be done dynamically on the form setting via VBA the .FilterBy condition and FilterByOn = TRUE in the combobox after update event.
SOLUTION 2
You can also think about a solution in which when you press the navigation button you search for the next record with desired status and the you move to that record. It's more tricky and sincerely I can't see any advantage but it depends on what you are imaging for your database.
Upvotes: 0