Leban's Tooltip code--- Help!

D

Damon Heron

I love this tooltip routine and have started putting it into my db. The
only thing I am asking of it is to allow the user to click on a question
mark (lblHeader) and display a form msg. It worked on the first form, and
the second, and the third. The fourth form, however, crashes at the Call.
..create line. "Object variable or with block variable not set"
I am baffled. I checked the form to make sure there weren't any
recordselectors on it, also. Here is the code of the load unload events- the
line
Dim TTip As clsToolTip
is in the form module.
************************
Private Sub Form_Load()
' Create an instance of our Tooltip class
Set TTip = New clsToolTip

' We must SetFocus to any control that can
' accept the focus in order to force Access to
' create the inplace editing Window.
Me.cboGr.SetFocus

With TTip
' Create the tooltip window
Call .Create(Me)' Stops here "Object variable or with block variable not
set"

' Set the tooltip window to show for 5 secs
.DelayTime = 5000

.SetToolTipTitle "TOOLTIP", 0

' ToolTip text colors
.ForeColor = vbBlue
.BackColor = RGB(192, 192, 192)



' Set the text for the Header label.
.SetToolText Me.lblHeader, "Here is the header"
End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
' Because of reference issues you must invoke
' the Cleanup sub prior to releasing the
' reference to the TTip class.
Tip.Cleanup ' On close, form hangs here same msg as on load.
' Release our reference to our class
Set TTip = Nothing
End Sub
 
D

Damon Heron

It might be helpful to note that this form that I am having problems with
has a subform with a sub-subform, and all are bound forms.

Damon
 
S

Stephen Lebans

Actually I have seen this error before. I never nailed it down but if I
remember correctly, there were two possible causes:

1) If I manually stopped the code running then this error would show
everytime I tried to put the form into View. THe only solution was to quit
Access and then immediately restart Access.

2) It was corruption behind my sample form and possibly in the ToolTips
class itself.
You can try Decompiling or what I prefer is to copy the entire contents of
the Tooltip class to Notepad, create a new blank Class module, and then copy
and paste from Notepad into the blank Class module. Make sure after you
delete the original ToolTips class module that you rename the new class
module to the original name.

Let me know if this resolves the error.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
D

Damon Heron

Stephen,
I had 15 forms and the tooltips worked on 9 of them, so I started looking at
the differences in the various forms. It turns out that solution came down
to setting the focus on a control in the detail section of the form, (I had
set the focus on a combobox in the header on a couple of the forms) and it
could not be a command button. In some cases, I created a dummy textbox to
receive the focus where there weren't any other logical controls to receive
the focus.

Again, thanks for a great control and your quick response to my question!

Damon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top