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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach sub procedure to Switchboard

Status
Not open for further replies.

VBACT

IS-IT--Management
Dec 4, 2002
24
US
Is there any way we can set a procedure to a switchboard button?

Would appreciate any help.

Thanks
 
If you made your own switchboard, you used command buttons. Go to design view of the form, click on one of the buttons and bring up its property sheet. Click on the event tab and you'll see a whole bunch of events you can program. If you have a macro written, click on the box next to one of the events (usually OnClick). Click on the dropdown arrow that appears and you'll see a list of your macros. Pick the one you want. Or you could click the Button with the three dots (Build Button), click on Code builder and create some code.

Neil
 
Thank you for the response. In the present stage of development I am using the switchboard manager. The switchboard manager does allow me to attach a function name to a command button, but not a procedure.

Any suggestions....?

Thanks
 
If you go to design view of your switchboard, you will see some buttons. They correspond to how many buttons you made from top down. Click on a button, bring up it's property sheet. On the OnCLick event something like =HandleButtonClick(,,) appears. This is a function the switchboard manager created and uses. You can click on this box and you'll see a drop down arrow. Click on the dropdown arrow and select Event Procedure. Then click on the Build Button (...). This will take you to VBA where you can write a procedure. Now when you click on this button, it will run your procedure, not the switchboard's managers.

Neil
 
Thank you, Neil....Will try and let you know
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top