ACC1x: How to Switch Form to Design Mode to Change PropertiesLast reviewed: May 7, 1997Article ID: Q101308 |
The information in this article applies to:
SUMMARYThere are a number of form properties in Microsoft Access that cannot be changed while the form is active. To work around this limitation, you can use a macro to change the form into Design view, use SetValue actions to change any property, and then change the form back to Datasheet view.
MORE INFORMATIONYou can change the form into Design view by using a DoMenuItem macro action as shown below:
MacroName Action
----------------------
Test1 DoMenuItem
Test1 Actions
-----------------------
DoMenuItem
Menu Bar: Form
Menu Name: View
Command: Form Design
When you use this method to change properties on a Microsoft
Access form, the following potential problems should be noted.
Problem 1When changing from Datasheet view to Design view, or from Design view to Datasheet view, the form is in Design view yet repainting takes place on the screen. To minimize this problem, set Echo Off before going into Design view. Turn Echo On after forcing the form back into Datasheet view. The following sample illustrates this method:
MacroName Action
----------------------
Test1 DoMenuItem
Echo
Test2 DoMenuItem
Echo
Test1 Actions
-----------------------
DoMenuItem
Menu Bar: Form
Menu Name: View
Command: Form Design
Echo
Echo On: No
Test2 Actions
------------------
DoMenuItem
Menu Bar: Form
Menu Name: View
Command: Browse
Echo
Echo On: Yes
Problem 2After a property is changed, the Save Form dialog box appears. To avoid this dialog box, set SetWarnings to Off from the form's OnClose event. If this is done in a macro, SetWarnings will automatically be reenabled after the form has been closed. The following sample demonstrates this method:
REFERENCESFor more information about changing control properties at run time, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q93298 TITLE : ACC1x: How to Use Visible Property to Simulate Property Changes |
Additional query words: flip switch browse mode runtime run time read only
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |