| [ Team LiB ] |
|
Converting a Macro to VBA CodeNow that you have discovered all the limitations of macros, you might be thinking about all the macros you've already written that you wish you had developed by using VBA code. Or, after seeing how easy it is to do certain tasks by using macros, you might be disappointed to learn how limited macros are. Fortunately, with Access 2003 it's easy to convert an Access macro to VBA code, and after you have converted the macro to VBA code, you can modify the code just as you would any VBA module. Follow these steps to convert an Access macro to VBA code:
Figure 13.21 shows a macro that Access has converted into distinct subroutines—one for each macro name. The macro is complete, with logic, comments, and error handling. Access converts all macro conditions into If...Else...End If statements and all the macro comments into VBA comments. It adds basic error-handling routines to the code. Figure 13.21. A converted macro as a module.
|
| [ Team LiB ] |
|