Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you call a module by clicking a button on a form in MS Access?

Status
Not open for further replies.

StarScream

Technical User
Oct 10, 2001
46
US
How do you call a module by clicking a button on a form in MS Access 2000?

Scenario: Form is used to add a suspense to a master list. Person would then click a button that would automatically email a person to tell them they have a new suspense. The form would have already have some of the information wanted to be included in the email (i.e. subject, email address, etc.)

How do you get a button to do this on a form?
PS - New to using MS Access

Thanks.
PJ
 
In design mode right click on the button, goto properties. Then goto the event tab, click on the field for OnClick, at the end of the field click on the button with "...", double click code builder. You should now see the VBA module for the form and should be in the OnClick event for your button. Simply type in the name of your module. You should be good to go now.
 
Although it isn't needed, I always prefix this with Call. Just helps me with tracking and debugging.

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top