ACC: No AutoRepeat with GoToRecord/Next and DoMenuItem

ID: Q95645


The information in this article applies to:


SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

The AutoRepeat property for command buttons does not work in conjunction with the GoToRecord/Next macro action for moving to successive records on a form. In other words, if your form uses command buttons instead of the record selector buttons to move from record to record, the AutoRepeat property does not repeatedly run a macro that performs a GoToRecord/Next action.

Also, the AutoRepeat property fails under the same circumstances when you use the DoMenuItem/Form/Records/GoTo/Next macro action. To rerun the macro, you must click the command button again.


CAUSE

This is correct behavior for these macro actions. Here are two points that need clarification before the cause can be explained:


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior


  1. Start Microsoft Access.


  2. Open the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0).


  3. Create a new macro as follows and save it as AutoRepeatTest:

    
           Macro Name      Action
           --------------------------
           AutoRepeatTest  GotoRecord
    
           AutoRepeatTest Actions
           --------------------------
           GoToRecord
              Object Type:  Form
              Object Name:  Customers
              Record:       Next 


  4. Open the Customers form in Design view.


  5. Drag the macro you have just created onto the form to create a command button.


  6. Set the AutoRepeat property of the command button to Yes. Note that the command button's OnClick property is set to the name of the macro.


  7. View the Customers form in Form view to browse the form and click the command button. Note that each time you click the command button, the record selector moves to the next record. When you click and hold down the command button, you would expect Microsoft Access to scroll rapidly to the last record in the table, but this does not happen. Instead, the record selector moves to the next record only, regardless of the command button's AutoRepeat property setting.

    However, if you add a macro that uses a different macro action, such as Beep, to the form, the AutoRepeat action works as expected. This is because Beep does not change the focus.



Keywords          : McrActn 
Version           : 1.0 1.1 2.0 7.0 97
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: March 19, 1999