ACC2000: AutoRepeat Is Disabled When Macros Change the Focus (209669)
The information in this article applies to:
This article was previously published under Q209669 Novice: Requires knowledge of the user interface on single-user computers.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
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. The following two points
need clarification before the cause can be properly explained:
- OnClick Property: The macro assigned to the OnClick property of a command button normally does not run until you click and let up the command button with the mouse pointer in the command button's region. The exception is when the command button's AutoRepeat property is set to Yes. In this case, the macro set for the OnClick property of the command button runs when the button is clicked and held down with the mouse pointer in the command button's region. The macro runs repeatedly as long as the button is held down.
- Focus: Several macro actions change the focus on the form. For example, GoToControl, GoToRecord, OpenForm, OpenTable, and ApplyFilter all
change the focus. Therefore, if a command button's OnClick property macro changes the focus on the form, for example, to the next record, the command button loses the focus until it is clicked again.
That is, when you hold down a command button with the button's AutoRepeat property set to Yes, and the macro changes the form's focus, your action (holding down the button) does not cause the macro to run again. You have to click the command button again. The button may even appear to still be held down, even after you have released the mouse button, but the macro does not run continuously.
REFERENCESFor more information about the AutoRepeat property, click Microsoft Access Help on the Help menu, type autorepeat property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about command button control properties, click Microsoft Access Help on the
Help menu, type command button control properties in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
Modification Type: | Major | Last Reviewed: | 6/28/2004 |
---|
Keywords: | kbprb KB209669 |
---|
|