When discussing the Microsoft Office Suite with your users, you probably have run into some negative feedback to that paper clip help thing that jumps up on the screen and offers to help you out. Why does this invoke a negative reaction in users. My guess is that the information being offered really is not relevant at the time. Also you probably still are not highly excited about have a power pup or a 110 year old genius telling you what a database is when you have been programming database for 20 years. Before we go any further, we may as well call this "know it all" by his/her programmable identity and that is the Balloon object. He/she also is sometimes refered to as the Office Assistant (when he behaves himself).
In this article I will show you how you can unleash the Balloon on the users of your software and hopefully provide them with some really information that is relevant to their current activity. To illustrate this, figure one shows Albert Einstein informing you how you can use the download that is provided with this article. As you can see, the information is well arranged and clearly informs you what to do with the software. You may now do a number of things with this piece of on screen advice. One is to keep it on the screen as is, another it to a move it to a more suitable position on the screen so that you can still see the advice and the third is to get rid of it. This article and its download database shows you how you can manipulate the Balloon object using visual basic and provides a class module to make that programming even easier.
Figure 1 – Inform Your Users With The Office Balloon (Click to expand)
Informing Your Users Of Enhancements To Your Software
The project where I first utilized this balloon technology was on an Access database with 10 or so users. After a while, the users stopped reading my emails informing them about changes to the software and basically just used the software until something went wrong. Initially I resolved this by putting up a message box with a list of the new options/changes that had recently been added to the software. After a while, it became apparent that message boxes are for pointing your mouse at so that they disapear as quickly as possible. Then I stumbled across the balloon and decided to use that as an alternative way of displaying the list of enhancements. With the messages in the balloon (figure 1), the user can keep the information on the screen and review the software at the same time. This is possible as the Balloon is not part of your Access interface. Another good thing about the Balloon is that bulleted items are a feature of the balloons display capabilities unlike message boxes where you have to introduce your own carriage returns and text bullets. So what do we have to do to fire up a balloon and add a message or two. Just add the following code to your application.
Set Balloon_FX = New FXc8_Balloon
Set Balloon_FX = Nothing
A Class Module Makes Office Automation Easier
Of course there was a bit more to releasing your first balloon than typing the few lines above and that leads me to my standard approach when I program complex Office objects. I generally build a class module to provide a simple gateway between the actual object and the application. This means that I have far less code in my actual applications plus I can make use of VB intellisense to assist me in my programming. So what do you need to do to add this class module to your application
Import the class module FXc8_Balloon from the supporting database
Import the module FXL8_Records from the supporting database
Open a module in your application.
Add a link to the Microsoft Office 8 or Office 9 Object Library
Now when you need to start up a balloon in your application, instantiate your Balloon class library as follows
Set Balloon_FX = New FXc8_Balloon
Now type the full stop on the next line and the following methods will become available to blow up and release your balloon
This is how you add the bulleted points to your balloon. You may add as many as you like but only the first 5 will be displayed on the balloon
HowFull is a property of the class module that will tell you how many messages you have added to the balloon.
You can clear all the messages from your balloon using this method.
.showBalloon Header, Text, Icon
Show balloon is the method that will display the balloon with your header. Text is an optional field to display additional text between your point messages and the header. Icon is also optional and varies the display of either a warning icon, a tip icon or no icon at all.
Set Balloon_FX = Nothing
And of course when you have finished adding notes to your balloon, do not forget to release the balloon object. Note that that the balloon will still float around with your Access application until your user clicks the OK button. I will return to the mechanics of manipulating the balloon later in the article.
Informing Your Users Of Problems With Their Data
An even more useful application of the Balloon object is informing users of problems with their data entry before they save a record on a form. This differs from the normal verification of data on a field by field basis. This technology is now getting its biggest workout in an insurance application with a complicated form with over 50 fields on the one form. In this form there was a number of levels of checking that need to be performed according to the progress of the insurance claim. In the inquiry level, the software only needed to check a few fields for correctness but when the claim was accepted, the levels of checking became quite complicated. Prior to use of the balloon, the user would face a maddening number of message boxes popping up during the data entry such as that in figure 2
Figure 2 – Message Boxes for Data Entry Issues Can Interfere With Data Entry
Now all the data integrity is handled at the end of the data entry using the balloon object and the user is presented with a maximum of five data entry issues at a time. Why five, well that is the maximum number of bulleted messages that the balloon will allow. Also five messages is a good number as any more would simply fill the screen with too much information. If there are more than 5 errors on the form at the one time, you can show the others after the user has tried to fix up the first five.
The secret to handling this type of checking before the record is saved lies in the Before Update event on the form. This event will fire up whenever the user tries to save a record even if the record is a brand new one. So if you open the Balloon demo form in the demonstration database in design mode, search for the Before_Update event module which goes something like this
Private Sub Form_BeforeUpdate(Cancel As Integer)
Set Balloon_FX = New FXc8_Balloon
' Now test the fields in the form
If IsNull(Me!EmployeeID) Then
If IsNull(Me!OrderDate) Then
If IsNull(Me!Freight) Then
If .howFull > 0 Then
' Now cancel the update to the form
Set Balloon_FX = Nothing
The code that I have used to display error messages varies little from the first example except that I now test if there are any error messages before displaying the balloon and canceling the form update event by setting the subroutine argument to Cancel.
To assist the user in saving the record, I generally add a save record button on the form which calls a database module called SaveRecord. You will be surprised how many users click on the Save Form button on the Toolbar to save the record which unfortunately does not save the current record.
Another anomaly that you may want to trap is when the user closes the form without saving the record. This results in the form update event being initiated but the form is closed without the user having any chance to modify the problems with the data. To handle this, I have a global subroutine called FormError_SaveRecord that is called from the Form Error Event.
Private Sub Form_Error(DataErr As Integer, _
Public Sub FormError_SaveRecord(DataErr As Integer)
What Sort Of Gas Fills The Balloon
For those of you that have avoided class modules in your programming, the balloon class module (called FXc8_Balloon) is a good example of how simple programming can be when you pick an appropriate task for your class. For this module, we have 3 class wide variables to store the messages as follows
Const NoMsgs = 20
The first thing that we will tell the class module after it is instantiated is the messages list. This is handled through the public subroutine pumpBalloon. In this case I could have also handled this using a class property but it is likely that I will possibly add additional optional arguments to the subroutine at a later date so a subroutine makes that enhancement simpler. The emptyBalloon and HowMany subroutines that are not show in the code snippets also handle the message list.
Sub pumpBalloon(Message As String)
All the action in the balloon class module happens in the subroutine showBalloon. If you want some associated reading on the topic, do no more than type in "Balloon" into your Access help. Here you will find that the Balloon is one of three objects shared across the Office suite. The other two are the Command Bar and the File Search object. One of the Balloon samples provided me with the basis on which this class module is based. The initial code of the ShowBalloon method handles the optional arguments in the routine. If you wish to find out alternative constants to use for the icon or mode or type of Balloon, right click on the constant and choose definition (alternatively Shift-F2).
Public Sub showBalloon(BalloonHeader
As String, _
Dim bln As Balloon, i As Integer
Note above that I have two hard coded constants for Balloon Mode or Type which I have set as Modeless and to display the OK button. These settings are the simplest settings of the Balloon and are entirely suited for the tasks that I perform in the demonstration database. Changing these options can give your users an interactive interface such as returning choices and yes / no selectors and a variety of other goodies. Be very careful about going too far down this path as you will then be setting up a conflicting interface for your users to learn and contend with. I have left a few notes inside the software to explain these constants. Now we instantiate the actual Office Balloon object and set up the balloon constants
Assistant.visible = True
And now we come to the setting of the Balloons mode and the actual display of the balloon using the show method.
.Mode = msoModeModeless
Which leaves the confusing CallBack method which is where you have to define a public subroutine that handles the closing down of the Balloon object. This must be setup exactly as follows.
Public Sub closeBalloon(bln As
My initial thoughts on this subroutine were to include it in the Balloon Class module as a public subroutine but alas this was not allowed as the callback does not recognise subroutines in Class Modules. So now I store this subroutine in one of the general modules that I usually add to all my applications. As for process of CallBack functions, the notes in MSDN 2000 indicate that they are available from DLL functions that seem to have been written by Microsoft. So you probably won’t write one of those in a hurry.
The Access Balloon Wizard
A really useful alternative to using the Balloon class library that I provided is to download the Access 97 Balloon builder wizard. This is show in figure 3 and really is a good way to add and learn more about the Balloon object. The wizard installs like any Access wizard and has a file name of wzBln97.mde I could not find a Access 2000 wizard that did the same thing.
Figure 3 The Access 97 Balloon Builder Wizard in action (click picture to view)
Its Time To Let The Air Out Of The Balloon
Having deployed the Office Assistant Balloon in a couple of busy applications over the last few months, my conclusions on the technology are simple. Use the Balloon to inform users in situations where it would be useful to actually keep the information on the screen whilst still interacting with your Access Application. The balloon lets you do this. Do not over utilize the balloon for simple messaging or its impact will be lost when you really need your messages to be read. I make sure that I put a date test on my messages so that they are not displayed too many days after they are first posted. And finally be really wary about using the user input management features of the Balloon object, as one of the hallmarks of good user interface design is consistency and Access forms and the Balloons do not look the same !!
Useful Further Reading and Resources
You can find a number of good online resources for managing the Balloon at the following address.
The balloon and Office XP ( Turn it back on again )
Probably the best page on the Microsoft site where you can easily pickup all the Access 97 & 2000 downloads is
Included in these downloads are lots of different Balloons (search for Assistant) such as Earl and Scribble the Cats, Mother Nature and you may even find Bruce the Kangaroo if you are lucky.
Garry Robinson is the founder of GR-FX Pty Limited, a company based in Sydney, Australia. If you want to keep up to date with the his latest postings on Access Issues, visit his companies web site at http://www.gr-fx.com/ or
is where you can sign up for newsletter and magazine that I use for most of
my new Access Knowledge. Other Pages On This Site You Might Like To Read
http://www.vb123.com/smart is where you can sign up for newsletter and magazine that I use for most of my new Access Knowledge.
Other Pages On This Site You Might Like To Read