Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Assign a a macro to button on user from

Posted on 2013-11-21
2
Medium Priority
?
489 Views
Last Modified: 2013-11-22
Hi Experts

I have a userform with a command button in ms access 2003 and I would like the button to call/run my macro Private Sub cmdMyButton_Click

how would I do this....what are the steps...
0
Comment
Question by:route217
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
QuinnDex earned 2000 total points
ID: 39668233
Open a form or a data access page in Design view.

Make sure the Control Wizards Button image tool in the toolbox is not pressed in. This turns off the wizard.

 In the toolbox, click the Command Button tool Control.

On the form or data access page, click where you want to place the command button.

Make sure that the command button is selected, and then click Properties Button image on the toolbar to open the command button's property sheet.

In the OnClick property box on a form, enter the name of the macro or event procedure that you want to run when the button is clicked, or click the Build button to use the Macro Builder or Code Builder. On a data access page, you can attach code written in either JScript or Microsoft Visual Basic Scripting Edition (VBScript) to a command button by using the Microsoft Script Editor.

Do one of the following:

To display text on a command button on a data access page: Type the text in command button's Value property box.

To display text on a command button on a form: Type the text in the command button's Caption property box.

To display a picture on a command button on a form: In the command button's Picture property box, type the path and file name for a .bmp, .ico, or .dib file. If you're not sure of the path or file name, click the Build button Button image to open the Picture Builder.
0
 

Author Comment

by:route217
ID: 39668351
Thanks for the feedback. ...excellent
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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