Microsoft Office Tutorials and References
In Depth Information
Discovering Code As You Go
Right-click the Visual Basic Editor button on the taskbar and then
choose the Close Window option from the contextual menu.
Press Alt+Q.
Access continues to run even after you close the VBE window.
Discovering Code As You Go
Most beginning programmers start by working with code that they pick
up elsewhere, such as code generated by code wizards or copied from a
website. You can also create VBA code without writing it by converting any
macro to VBA code.
Converting macros to VBA code
Any macro that you create in Access can be converted to VBA code.
Converting macros to code is easier than writing code from scratch.
Suppose that you need to write some code because a macro can’t do the job,
and say that a macro can do 90 percent of the job. If you create the macro
and convert it to VBA code, 90 percent of your code is already written. You
just have to add the other 10 percent (which is especially helpful if you can’t
type worth beans).
See Book VI, Chapter 1 for information on how macros work and how to
create them.
Suppose that you click the Create tab and then click the Macro button in the
Macros & Code group on the Ribbon (see Figure 1-15) to create a new macro.
The macro can be as large or as small as you want.
Chapter 1
Figure 1-15:
Create a
new macro.
Figure 1-16 shows a simple macro that displays a message onscreen.
After you create your macro, close and save it — perhaps with the name
Search JabSto ::

Custom Search