Back to first record, then forward

  • Thread starter Me!Frustrated = True
  • Start date
M

Me!Frustrated = True

I use a form (single form) for Equipment Maintenance that shows both existing
issues and those that have been resolved. I added a simple "Find" button
that should navigate to any records that exist for any recurring problems
with a particular unit. Here is the button code:
Private Sub cmdProblems_Click()
Dim myAsset As Long
myAsset = Me.AssetID
Me.AssetID.SetFocus
DoCmd.FindRecord myAsset, , , , , , False

My problem is, I can only set the options for FindRecord to either start
searching at the first record, or at the one right after the current record.
If a user is looking at the most recent record, I would like the search to
start again at the beginning of the recordset, then continue on through
subsequent problems. Is there a way to do what I want using this method, or
do I have to use another method? Or, can a form's properties be set so that
navigating to the "next" record will return to the first record in the set?

TIA
 
J

Jeff Boyce

I can't quite tell whether you want to find ALL of the issues related to a
piece of equipment, or only the most recent (you must have a date/time field
stored somewhere), or ????

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
F

fredg

I use a form (single form) for Equipment Maintenance that shows both existing
issues and those that have been resolved. I added a simple "Find" button
that should navigate to any records that exist for any recurring problems
with a particular unit. Here is the button code:




My problem is, I can only set the options for FindRecord to either start
searching at the first record, or at the one right after the current record.
If a user is looking at the most recent record, I would like the search to
start again at the beginning of the recordset, then continue on through
subsequent problems. Is there a way to do what I want using this method, or
do I have to use another method? Or, can a form's properties be set so that
navigating to the "next" record will return to the first record in the set?

TIA

Why not simply filter the records according to the AssetID field
displayed on the form, then just cycle through the filtered records as
you would normally?

AssetID is a Number datatype?

Private Sub cmdProblems_Click()
Me.Filter = "AssetID = " & Me!AssetID
Me.FilterOn = True
End Sub

When through, click on the Remove Filter tool button, or right click
on the form and select Remove Filter/Sort, and you will be back to
showing all the records.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top