Tool Tips Utility for Microsoft Access 
from: BnB Group, Inc.
P. O. Box 1326
Mukilteo, WA  98275
71564,1711

	As a full time Access developer and part time Visual Basic 
programmer, I have the opportunity to work with both development 
platforms.  My complaint with most of the Access applications I have 
seen is that the developers apply VB limitations to their Access apps.  
In my development work, I try to add color and icons to give the user 
a friendly and lively interface.  Access is far and away much better 
at allowing me to do this than VB.  Therefore, I use many toolbars and 
iconized command buttons in Access.  To make these command buttons 
more user friendly and consistent, I like to use the Tool Tips.  

	At the end of this file, I have copied a knowledge base article 
from Microsoft on how you would program a floating tool bar.  You 
should also read the Access on-line help on how to use some of Access' 
resident icons with associated Tool Tips.  For most users, these will 
take care of 90% of your needs.  However, there will be situations 
where you want a custom tip or custom icon, that is where this utility 
will help.

You can choose to install this program in two ways.  

First, copy the file:  ToolTip.mda into your Access directory.  
There should be other files with the .mda extension there as well.  
Next, open Access and an application.  It makes no difference now 
which one you open.  From the FILE menu, select ADD-INS, and then 
select the ADD IN MANAGER  to add the Tool Tip library to Access.  
Highlight the entry:  TOOLTIP  and press the INSTALL command 
button.  TOOLTIP should have an X next to it. Next, exit and then 
re-enter Access to enable the ToolTip utility.  Now you are ready 
to format your forms.

The second way to load this utility is only for registered users 
who purchase the source code ($20 includes both).  You can simply 
open the database of your choice and import the ToolTip module.
 
From this point on, I will assume that you have loaded or "added in" 
the Tool Tip library.  After you enter Access, load the demo program:  
TTDemo.mdb.  This small database has a sample form that will show how 
to use a form with icons for a floating toolbar.  Remember, you can 
also add icons in a toolbar along the form header.  Just leave some 
room below the icons to display the tool tips.  [This demo 
automatically loads the function that starts the utility.  You will 
need to follow the instructions in the next paragraph to run the 
utility from your program]

To configure your forms and add your custom tool tips, select the Add 
Ins option again from the File menu. Then select Tool Tip from the 
menu choices and everything else is automatic.  

This utility will configure your forms for you automatically.  When 
you run the function:  StartToolTip(), it will move through all of the 
forms in your database and look for command buttons, it will then ask 
you to input the tool tip for each of the command buttons (simply 
press enter to skip),  and finally, it will add an invisible tool tip 
template to each form.

After you run the StartToolTips utility once, you should not need to 
run it again on that database; the tool tips will display 
automatically.  In other words, when you move the mouse over the 
command button, the tip will show.


NOTES AND WARNINGS   P L E A S E   R E A D!!!

Before you run this utility on a database, back it up or make a 
copy in case something goes wrong.  
 
The program will add a function call to the ONMOUSEMOVE event for 
each section that has a command button and each command button.  If 
you already have something programmed for that event, it will be 
written over unless you answer "no" to the question that asks: "Do 
you want to save changes to your form".

You must have enough room below each command button to display the 
tooltip. If you do not leave enough room, the tip simply will not 
display.  The room you leave must be in the same section (for more 
info., check Access help under Section) as the command button.

The first time you try and display the tip, it takes a little extra 
time as the code loads.  Once the function loads, the tips take a 
second or less.  Using the Timer in Access 2.0, you can set this to 
as long a delay as you want (you must purchase the source to do 
this, $20)

When the program finishes with your form, it beeps a couple of 
times and asks if you want to save the changes, answer YES (unless 
you do not want tips on that form).

The program will add an invisible label control to each section 
that has a command button.  Do not delete this small yellow label 
in the upper right hand corner or tool tips will not work on that 
form.

The first time you use a tool tip on Mondays in the unregistered 
version, we will give you a Nag Screen asking you to register.  $10 
registration will take care of it.

If you find that a tip does not shut off by itself, it probably 
means you have a command button on top of another control.  For 
example, it may be in a rectangle.  Simply set the ONMOUSEMOVE 
event to:  =ToolTipOff(Screen.ActiveForm) for the container around 
the command button and it will work OK.  Or, simply move your mouse 
to the general detail area on the form and it will turn off  If you 
continue to have problems, register the program and we will send 
you a detailed help file to give you more information.

If you purchase the source code, you can set the length of delay 
for the tips as well as add the ability to put tips on other 
controls besides command buttons.

For each tip, we have set a default character spacing. For most text 
written in lower case with a leading cap., the standard format works 
just fine.  However, since we are using a proportional font you might 
have some tips with extra room left in the tip display box and others 
with not enough room to fully display the tip text. If you find that 
the text fails to fit into your tip box, then simply add leading 
and/or trailing spaces.  You do not need to run the StartToolTips 
again (you can if you want), but open the form in form design and 
click on the command button whose tip you want to change and edit the 
ONMOUSEMOVE event.  It will look something like this: 
=ToolTipOn(Form,[EnterPIN],'Press to Enter your PIN').  If you can't 
see all of the text, highlight the field and press the Shift and F2 
button at the same time to bring up the zoom box.  Add a few spaces 
before and after the text string but inside the apostrophes.



Registration

First of all, let me say that if you want to use this program "as is" 
with no additional documentation and you do not mind the Nag Screen 
popping up each Monday and you cannot afford 10 bucks, use the program 
with my blessing.  You might even drop me a note on Compuserve and 
tell me what you think.

If you want to get rid of the Monday Nag Screen and/or want additional 
"tips" on how to use this program along with ideas of how to use tool 
tips in your application, send me ten bucks along with your Compuserve 
address and I will send you the registered file and a text file of 
more info.

If you want to see how we make the tips work or want to modify them 
for your own application, send us $20 and we will send you the 
unlocked code along with a text file describing how the program works 
and how you might want to change or customize it.

Simply mail your check for $10 or $20 to:

BnB Group, Inc.
P. O. Box 1326
Mukilteo, WA  98275-1326

Include your Compuserve Address and we will E-Mail you the files the 
same day we receive your check.



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





INF: How to Create a Custom Toolbar Using a Form

Article ID: Q113304

---------------------------------------------------------------------

The information in this article applies to: - Microsoft Access version 
2.0

---------------------------------------------------------------------

SUMMARY



This article describes how to create a custom, floating toolbar using 
a Microsoft Access form. 



Using a form for a custom toolbar provides the following advantages:

  Labels, combo boxes and list boxes can be placed on the toolbar. 
  
  Buttons with custom bitmaps can be placed on the toolbar.
  
  You can prevent users from closing or moving the toolbar.
  
  You can take advantage of form modules to store the code being used 
by   the controls on the toolbar with the toolbar itself.
  
  You can disable the shortcut menus from being used on the toolbar.
  
  
  
MORE INFORMATION================



The example below demonstrates how to create a custom, floating 
toolbar that has buttons to find, save, delete, and undo a record, as 
well as buttons to navigate among the records, including buttons to go 
to the first  record, go to the previous record, go to the next 
record, go to the last record, and add a new record.



Open the sample database NWIND.MDB and create a new, blank form.
 
Set the following form-level properties:

       Caption: Tool bar

       ShortcutMenu: No

       ScrollBars: Neither

       RecordSelectors: No

       NavigationButtons: No

       PopUp: Yes

       BorderStyle: Dialog

       MinButton: No

       MaxButton: No

  3. Activate the toolbox by choosing Toolbox from the View menu. Make 
sure the Wizard button is chosen (the button should appear sunken).

  4. Choose the command button tool, and then click anywhere in the 
form.

  5. In the Categories box, select Record Navigation. In the When 
Button Is Pressed box, select Find Record. Choose Finish.

  6. Drag the new button to the upper left corner of the detail 
section.

  7. Repeat steps 4-6 to create the other buttons for the toolbar. Use 
the  following selection combinations from the Categories and the 
When  Button Is Pressed boxes. Move each of the new buttons 
directly to the right of the button before it.



        Categories             When button Is Pressed

       ---------------------------------------------

       Record Operations      Save Record

       Record Operations      Delete Record

       Record Operations      Undo Record

       Record Navigation      Go to First Record

       Record Navigation      Go to Previous Record

       Record Navigation      Go to Next Record

       Record Navigation      Go to Last Record

       Record Operations      Add New Record

  8. Drag the bottom of the detail section up so that it is flush with 
the bottom of the buttons. Drag the right side of the detail 
section so that it is flush with the right side of the last button.

  9. From the View menu, choose Code.

10. Create the following Access Basic function in the toolbar form 
module:



        Option Explicit

        Function ActivateToolbarForm ()

          On Error Resume Next

          Forms(Me.Tag).SetFocus

          If Err Then

             ActivateToolbarForm = False

          Else

             ActivateToolbarForm = True

          End If

       End Function



     This function will be used to reactivate the form the toolbar is 
floating on, so that the chosen operation is performed on that form 
rather than against the toolbar form itself.



11. For each button on the toolbar form, insert the following line of 
code at the very top of the button's OnClick event procedure. To 
insert the code, select a button, click the right mouse button in 
the OnClick property field, and then choose Build.



      If ActivateToolbarForm() = False Then Exit Sub



     For example, the code for the Search button might look like the 
following:



       Sub Button0_Click ()

       If ActivateToolbarForm() = False Then Exit Sub

       On Error GoTo Err_Button0_Click

           DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, 10, , A_MENU_VER20

         Exit_Button0_Click:

          Exit Sub

        Err_Button0_Click:

          MsgBox Error$

          Resume Exit_Button0_Click

       End Sub



     This code ensures that the form the toolbar is floating on is 
selected for the chosen operation.



 12. Save the form with the name Toolbar, and then close the form.



 13. Create a new Access Basic module. Add the following code: 



       Option Explicit

        Sub SetToolbarForm (F As Form)

          If IsLoaded("Toolbar") Then Forms![Toolbar].Tag = F.Name

       End Sub



    The SetToolbarForm subroutine uses the IsLoaded() function that is 
in the Utility Functions module in NWIND.MDB. You should copy this 
function for use in other databases.



 14. For every form that you intend to use the custom toolbar with, 
add the following line of code to the form's OnActivate property:



        SetToolbarForm Me



     For this example, add the line of code above to the OnActivate 
property of the Customers and Employees forms: 



    a. Open the Employees form in Design view.

    b. From the View menu, choose Code.

    c. Select Form in the first combo box on the code toolbar.

    d. Select Activate in the second combo box on the code toolbar.

    e. Add the above line of code so the subroutine appears as 
follows:

           Sub Form_Activate ()

             SetToolbarForm Me

          End Sub

    f. Repeat steps a-e for the Customers form.



      This line of code instructs the custom toolbar to store the name 
of the form to be used when a toolbar button is chosen. This ensures 
that the toolbar actions are performed against the active form.



Using the Custom Toolbar

------------------------

Open the Customers and Employees forms in Form view, and then open the 
Toolbar form. Switch back and forth between the Employees form and the 
Customers form, using the navigation buttons on the custom toolbar to 
navigate among the form records.



 Suggested Enhancements to the Custom Toolbar

--------------------------------------------

  - You may want to automate the loading and closing of a custom 
toolbar form from another form's load and unload events. For example, 
to have the custom toolbar open only with the Customers form, add the 
following code to the Customers form's OnLoad and OnUnLoad properties:



       Sub Form_Load ()

         DoCmd OpenForm "Toolbar"

      End Sub

       Sub Form_Unload (Cancel As Integer)

         DoCmd Close A_FORM, "Toolbar"

      End Sub



  - You can set the BorderStyle property of the toolbar form to None, 
so that no border and no caption bar appears. This will prevent users 
from being able to move the toolbar around. 



 - You may want to automatically position the toolbar form to a 
specific location on the screen. To do this, use a MoveSize macro 
action in the toolbar form's OnLoad property. The following sample 
code will position the toolbar form to the upper left corner of the 
screen: 



      DoCmd MoveSize 0, 0



Additional reference words: 1.00 1.10 2.00 tool bar

KBCategory:

KBSubcategory: FrmsOthr

Copyright 1993 Microsoft Corporation. All rights reserved.


