Link to home
Start Free TrialLog in
Avatar of SowleMan
SowleManFlag for United States of America

asked on

What is the best way to implement a control buttons that would allow the operator to move to "Next" record in a bound form?

I would like to create a button that allows the operator to skip to the next record in a bound form. The recordsource for the form is a query. When I click "Next", it triggers the btnNext_Click event, where I used VBA to code

If Me.Dirty Then
        Me.Undo
End If
docmd.gotorecord , , acnext

I get error messages telling me that docmd.gotorecord ,, acNext cannot be executed unless the form is a Continuous form. My form is a Single form. Do I have to make the form unbound and provide all my own opens, loads, record navigations, etc using DAO?  Or is there a simpler way around this problem?

I would prefer to let ACCESS handle all aspects of the form and record manipulation, except my application requires a "Next" button that will Undo any changes to the current record (if dirty) then move to the next record in the query's dataset.
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial