IT tutorials
 
Office
 

Microsoft Access 2010 : Other New Features Available in Macros & Testing a Macro

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
10/28/2011 6:45:44 PM

Other New Features Available in Macros

There were two major improvements introduced with Access 2007 macros. The first is the introduction of error handling, and the second is the introduction of variables. Notice the OnError macro action in Figure 1. The example branches to a macro named ErrorHandler in the case of an error. Unlike previous versions of Access, where error handling in macros was virtually nonexistent, the new OnError macro action provides similar error handling to that of VBA code (the programming language for Microsoft Access).

Figure 1. The OnError macro action provides similar error handling to that of VBA code.



Another exciting addition to Access 2007 macros was the introduction of variables. The new SetTempVar macro action enables you to create a variable and assign it a value. Figure 2 provides an example. Notice in the figure that the macro uses the SetTempVar action to create a variable called CurrentDate and assign it the value returned from the built-in Date() function.

Figure 2. You use the SetTempVar action to create a temporary variable in a Microsoft Office Access 2010 macro.


Testing a Macro

Although Access doesn’t offer very sophisticated tools for testing and debugging your macros, it does give you a method for stepping through each line of a macro:

1.
Open the macro in Design view.

2.
Click Single Step in the Tools group of the Design tab.

3.
To execute the macro, click Run. The first line of the macro is executed, and the Macro Single Step dialog box appears, showing you the Macro Name, Condition, Action Name, and Arguments, as in Figure 3. In the figure, the macro name is mcrPersonalInfo, and the condition evaluates to false. The action name and arguments are not available.

Figure 3. In the Macro Single Step dialog box, you can view the macro name, condition, action name, and arguments for the current step of the macro.


4.
To continue stepping through the macro, click the Step button on the Macro Single Step dialog box. If you want to halt the execution of the macro without proceeding, click the Stop All Macros button. To continue normal execution of the macro without stepping, click the Continue button.

The Single Step button in the Tools group of the Design tab is a toggle. After you activate Step Mode, it’s activated for all macros in the current database and all other databases until you either turn off the toggle or exit Access. This behavior can be quite surprising if you don’t expect it. You might have invoked Step mode in another database quite a bit earlier in the day, only to remember that you forgot to click the toggle button when some other macro unexpectedly goes into Step mode.

 
Others
 
- Microsoft Access 2010 : Creating a Drillthrough Macro
- Microsoft Word 2010 : Creating a PDF Document
- Microsoft Word 2010 : Creating a Word Outline from a Presentation & Creating and Opening OneNotes
- Microsoft PowerPoint 2010 : Adding Sound to a Transition & Modifying Transition Speed
- Microsoft PowerPoint 2010 : Adding Transitions and Animations - Applying a Transition
- Microsoft Excel 2010 : Recovering a Workbook
- Microsoft Excel 2010 : Documenting Workbook Properties & Switching Views
- Microsoft Outlook 2010 : Working in the Calendar Module (part 2) - Calendar Item Windows
- Microsoft Outlook 2010 : Working in the Calendar Module (part 1) - Calendar Module Content
- Customizing Microsoft OneNote 2010 : Setting Display Preferences (part 5)
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us