Developing code in VBE to use with forms

  • Thread starter Thread starter Brian C
  • Start date Start date
B

Brian C

I'm new to Access but have used Excel Macros extensively.

If I create a macro in Access and then go into VBE that
macro is not there. Similarly if I create a macro in VBE
and then try and connect it to a button on a form it
doesn't show up in the list of macros.

Is there some form of separation of ACCESS and VBE macros
and how can I get around it? I want to develop code in VBE
and then run it when a button is clicked on a form.

Thanks in advance.
 
Macros and VBA (Visual Basic for Applications) code *are* separate and
distinct in Access. While you can convert a Macro to VBA in MS Access,
there is AFAIK no capability to convert VBA to a Macro.

To see how VBA in Access works, try using the CommandButton wizard on a form
in Design View. Create a couple of buttons to do something like Go to Next
Record, Open Report, etc. Then, right click on a button, go to properties,
and look for the On Click Event. The row should contain [Event Procedure].
Click anywhere in that row and then click the little button with the
ellipsis (...) symbol. This will open the VBA code window for that event.

Of course, there is much more to VBA code than simple form events. You may
want to consider a reference book or two: There are some good
recommendations as:

http://www.viescas.com/Info/books.htm#Visual Basic
 
Back
Top