Sunday, December 2, 2007

Chapter 15 - Using Visual Basic in Access


Here's my first Visual Basic Sub Procedure in Access.



Here's what happens when I open the module click on Run Sub/User Form, select the sub procedure I want to run and click run. Obviously my sub procedure opens the G3170 table.




Here's a macro that does the same thing as the sub procedure in my module, only all I have to do is double click it in the Navigation Pane to open the G3170 table.
The macro makes a whole lot more sense to me and is easier to use.
Our text says that modules are a collection/organization of procedures which can be used for a specific purpose. I certainly need a set of related procedures to manipulate my inception to date data for printing out the monthly reports. However, the Access Visual Basic commands seem much less intuitive than the Excel Visual Basic commands I use. In addition, Access doesn't have a macro recorder similar to the one in Excel, which records keystrokes automatically.
I will most likely use Excel to manipulate the inception to date data and then import it into Access to make good use of its excellent report formating capabilities.