Developing code in VBE to use with forms

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.
 
C

Cheryl Fischer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top