IT tutorials
 
Office
 

Microsoft Access 2010 : Converting a Macro to VBA Code

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
11/7/2011 5:31:14 PM
Sometimes you will create a macro, later to discover that you want to convert it to VBA code. Fortunately, Access 2010 comes to the rescue. You can easily convert an Access macro to VBA code; after the macro has been converted to VBA code, the code can be modified just like any VBA module. Follow these four steps to convert an Access macro to VBA code:


1.
Open the macro you want to convert in Design view.

2.
Select Convert Macros to Visual Basic in the Tools group on the Macro Tools Design tab of the Ribbon. The Convert Macro dialog appears (see Figure 1).

Figure 1. The Convert Macro dialog box allows you to save a macro as a Visual Basic module.


3.
Determine where you want to add error handling and comments to the generated code, and then click Convert. Access informs you that the conversion finished and places you in the Visual Basic Editor - VBE (see Figure 2).



Figure 2. The Visual Basic Editor allows you to view and modify the programming code that you generated.

4.
The converted macro appears under the list of modules with Converted Macro: followed by the name of the macro. Click Design to view the results of the conversion.

Figure 3 shows a macro that’s been converted into distinct subroutines, one for each macro name. The macro is complete with logic, comments, and error handling. All macro conditions are converted into If...Else...End If statements, and all the macro comments are converted into VBA comments. Basic error-handling routines are automatically added to the code.

Figure 3. A converted macro as a module.


When you convert a macro to a Visual Basic module, the original macro remains untouched. Furthermore, all the objects in your application will still call the macro. To effectively use the macro conversion options, you must find all the places where the macro was called and replace the macro references with calls to the VBA function.

 
Others
 
- Microsoft Word 2010 : Adding Supplementary Elements - Working with Pages
- Microsoft Word 2010 : Creating an XPS Document
- Microsoft Visio 2010 : Tips for Creating Process and Flowchart Diagrams (part 1)
- Microsoft Visio 2010 : Tips for Creating Process and Flowchart Diagrams (part 2)
- Microsoft PowerPoint 2010 : Applying a Custom Animation to an Object
- Microsoft PowerPoint 2010 : Choosing How to Advance a Slide
- Microsoft Excel 2010 : Modifying a PivotTable & Formatting a PivotTable
- Microsoft Excel 2010 : Analyzing Data Using a PivotTable or PivotChart
- Microsoft Outlook 2010 : Using Other Outlook Template Types
- Microsoft Outlook 2010 : Working with Email Templates
 
 
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