Solved

Run a Module from a Command Button

Posted on 2011-03-10
3
394 Views
Last Modified: 2012-05-11
Using Access 2007.

I've created a Macro in Access.  I then created a Form and Command button that will run the Macro.

I then converted the Macro to a VBA module and added some additional steps to the VBA.  How can I run the converted macro from the same button?  It only gives the option of running macros?

Thanks
0
Comment
Question by:tfewster500
  • 2
3 Comments
 
LVL 19

Expert Comment

by:Bardobrave
ID: 35096340
Assign macro's name to button's onClick event.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35096343
select [Event Procedure] in the click event of the button
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 35096362
select [Event Procedure] in the click event of the button, then click on the (...)

in the vba window

private sub button_click()

' call the function/sub here
end sub
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question