Solved

Run a Module from a Command Button

Posted on 2011-03-10
3
385 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…

825 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