Link to home
Create AccountLog in
Avatar of leta37
leta37

asked on

Whats This Button event

Access 2003 Database - nothing out of the ordinary

I have enabled the 'Whats this button' on the form, so now I have a nice little button next to the close box with a question mark in it. How can I make a msgbox appear when the user clicks on this ? button.
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Show All

WhatsThisButton Property
See AlsoApplies ToExampleSpecificsYou can use the WhatsThisButton property to specify whether a What's This button is added to a form's title bar. Read/write Boolean.

expression.WhatsThisButton
expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks
The WhatsThisButton property uses the following values:

Setting Visual Basic Description
Yes True  A What's This button appears on the title bar.
No False  (Default) A What's This button doesn't appear on the title bar.

You can set the WhatsThisButton property by using the form's property sheet, a macro, or Visual Basic.

This property can be set only in form Design view.

You can't display the What's This button on the title bar of a form unless the MinMaxButtons property is set to None.

Clicking the What's This button on the title bar of a form causes the question-mark mouse pointer to appear. With the question-mark pointer, you can click any control to access its custom Help topic specified by the control's HelpContextID property. If the control doesn't have a custom Help topic, the form's custom Help topic is displayed. If neither the form or the control has a custom Help topic, Microsoft Access Help is displayed.

Example
The following example places a What's This button on the title bar of the "Switchboard" form. The form must be in form Design view, or else a run-time error will occur.

Forms.Item("Switchboard").MinMaxButtons = 0
Forms.Item("Switchboard").WhatsThisButton = True
            
Avatar of leta37
leta37

ASKER

Ok... so there isnt actually a way to just make that button display a msgbox when clicked?
that  { ? } button is for help. it will open the help pane.

to have a msgbox to appear in the click of the { ? }, afaik, can not be done with simple VBA codes. this may require modification thru the api codes.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of leta37

ASKER

Ok... on that note then... can you add custom buttons in the title bar which can do anything u want?
<can you add custom buttons in the title bar which can do anything u want>

NO
No ... but you can do this:

See this link:

http://www.jamiessoftware.tk/articles/menubars.html
       
Not sure it that article mentions it, but ... when you are in the Customize mode (dialog) ... if you hold down the Control key, you can drop and drag (ie, copy) menu items from one place to another ... handy for making a new menu that is similar another one.

mx
leta37,
do you really want to pursue using a ? box with a message appearing when click?
you could do this creating your own using label and placing them on the header of the form. Set the border style of the form to None.
in click event of the label show your message box.
Avatar of leta37

ASKER

I have found ways to do it, but im not using a thousand lines of code to make one button popup a msgbox...
who mentioned thousand lines of codes?
Note.  The answer to your original Q is basically You Can't .... which is what I first posted  states.

If you want to do a work around, maybe another Q is appropriate ...

mx