stephen lebans tool tip

G

Guest

I have loaded the tool tip generator from lebans and copied the forms and
modules into an exisitng database of mine.

when i open the ftooltip form exam ples, it works ok..

But when i incorporte them into one of my forms and change things as
appropriate (i think at least). when i open the form , the following error
mesage appears
RUNTIME ERROr 91 , object varialbe or with block variable not set.


any thoughts
 
S

Stephen Lebans

Not sure what to tell you Patrick. Since the sample form works in your MDB
but your own form does not then obvioulsy you have not implemented the
Tooltips class correctly. Post all of the code behind your form so I can
have a peek to see what you left out.

--

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

Guest

and thanks for the assistance on the animated gif's, your solution has been
implemented and works great
 
G

Guest

here it is:

there is also a mcro being run on the 'on open'... but it just maximises the
form

Option Compare Database
Option Explicit
' Copyright Lebans Holdings 1999 Ltd.

' Declare an object of type our toolTip class
Dim TTip As clsToolTip
'
Private Sub cboFindACustomer_MouseMove(Button As Integer, Shift As Integer,
X As Single, Y As Single)
'Debug.Print "mouseMove:" & "X:" & X & " y:" & Y
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click


DoCmd.GoToRecord , , acFirst

Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click

End Sub
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command18_Click:
Exit Sub

Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click

End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click


DoCmd.GoToRecord , , acNext

Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click

End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click


DoCmd.GoToRecord , , acLast

Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub
Private Sub Command21_Click()
On Error GoTo Err_Command21_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command21_Click:
Exit Sub

Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click

End Sub
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click


DoCmd.Close

Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub
Private Sub Combo24_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "
Code:
 = " & Str(Nz(Me![Combo24], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

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.Combo24.SetFocus

With TTip
' Creat the tooltip window
Call .Create(Me)

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

.SetToolTipTitle "CUSTOM TOOLTIPS", 0

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

' Set the ToolTip text for the controls on this Form

' Set the text for the txtCompanyName control.
'.SetToolText txtCustomerID, "I am the CustomerID control." & vbCrLf &
"This is the second line and I am trying to see if it wraps by itself without
a VBCRLF!"
' .SetToolText Me.Combo24, "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
ABCDEFGHIJKLMNOPQRSTUVWZXXABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
I am the CustomerID control. This is the second line and I am trying to see
if it wraps by itself without a VBCRLF!"

' Set the text for the txtCompanyName control.
.SetToolText Me.Client, "CompanyName - I am the CompanyName control." &
vbCrLf & "This is the second line!"

' Set the text for the txtContactName control.
' .SetToolText Me.txtContactName, "Contact Name - I am the ContactName
control." & vbCrLf & "This is the second line!"

' Set the text for the SelectACustomer ListBox control.
' .SetToolText Me.lstSelectACustomer, "SelectACustomer - I am the
SelectACustomer ListBox control."

' Set the text for the FindACustomer Combo control.
' .SetToolText Me.cboFindACustomer, "FindACustomer - I am the
FindACustomer Combo control."

' Set the text for the Image control.
'.SetToolText Me.Image01, "Image - I am the Image01 control." & vbCrLf &
"This is the second line!"

' Set the text for the Line control.
'.SetToolText Me.Box01, "Line - I am the Box01 control." & vbCrLf &
"This is the second line!"

' Set the text for the txtCustomerID label.
' .SetToolText Me.CustomerID_Label, "I am the CustomerID Label." & vbCrLf
& "This is the second line!"

' Set the text for the CompanyName label.
'   .SetToolText Me.CompanyName_Label, "I am the CompanyName Label." &
vbCrLf & "This is the second line!"

' Set the text for the ContactName label.
'  .SetToolText Me.ContactName_Label, "I am the ContactName Label." &
vbCrLf & "This is the second line!"

' Set the text for the SelectACustomer label.
'  .SetToolText Me.Select_a_Customer_Label, "I am the Select a Customer
Label." & vbCrLf & "This is the second line!"

' Set the text for the FindACustomer label.
'  .SetToolText Me.Find_a_Customer_Label, "I am the Find a Customer
Label." & vbCrLf & "This is the second line!"


' Set the text for the Notes label.
'  .SetToolText Me.Lablel_Notes, "I am the Notes Label." & vbCrLf & "This
is the second line!"

' Set the text for the NOTES TextBox control.
' .SetToolText Me.txtNotes, "I am the Notes control."

' Set the text for the Notes label.
' .SetToolText Me.Toggle43, "I am the Toggle Button." & vbCrLf & "This is
the second line!"

' Set the text for the Notes label.
' .SetToolText Me.Check46, "I am the CheckBox Control." & vbCrLf & "This
is the second line!"

' Set the text for the Notes label.
'   .SetToolText Me.Option44, "I am the Option Button." & vbCrLf & "This is
the second line!"

' Set the text for the Header label.
'    .SetToolText Me.LabelHeader, "I am the Header Label."
' Set the text for the Footer label.
'    .SetToolText Me.LabelFooter, "I am the Footer Label"


End With

' Fill in our NOTES unbound TextBox
'Me.txtNotes = "Move your Mouse over the any of the controls to see the
Custom Tooltips." & vbCrLf
'Me.txtNotes = Me.txtNotes & "Try moving the Mouse over the ListBox." & vbCrLf
'Me.txtNotes = Me.txtNotes & "This works even if the ListBox does not have
the focus!"
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.
TTip.Cleanup
' Release our reference to our class
Set TTip = Nothing

End Sub
 
S

Stephen Lebans

Without even going through your code I thought the comments in the source
code state that you must setfocus to a TextBox control, not a Combo or
ListBox control. Modify your logic to setfocus to a TextBox control and see
if that solves your issue.

Let me know.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
Patrick Stubbin said:
here it is:

there is also a mcro being run on the 'on open'... but it just maximises
the
form

Option Compare Database
Option Explicit
' Copyright Lebans Holdings 1999 Ltd.

' Declare an object of type our toolTip class
Dim TTip As clsToolTip
'
Private Sub cboFindACustomer_MouseMove(Button As Integer, Shift As
Integer,
X As Single, Y As Single)
'Debug.Print "mouseMove:" & "X:" & X & " y:" & Y
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click


DoCmd.GoToRecord , , acFirst

Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click

End Sub
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command18_Click:
Exit Sub

Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click

End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click


DoCmd.GoToRecord , , acNext

Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click

End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click


DoCmd.GoToRecord , , acLast

Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub
Private Sub Command21_Click()
On Error GoTo Err_Command21_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command21_Click:
Exit Sub

Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click

End Sub
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click


DoCmd.Close

Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub
Private Sub Combo24_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "
Code:
 = " & Str(Nz(Me![Combo24], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

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.Combo24.SetFocus

With TTip
' Creat the tooltip window
Call .Create(Me)

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

.SetToolTipTitle "CUSTOM TOOLTIPS", 0

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

' Set the ToolTip text for the controls on this Form

' Set the text for the txtCompanyName control.
'.SetToolText txtCustomerID, "I am the CustomerID control." & vbCrLf &
"This is the second line and I am trying to see if it wraps by itself
without
a VBCRLF!"
' .SetToolText Me.Combo24, "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
ABCDEFGHIJKLMNOPQRSTUVWZXXABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
I am the CustomerID control. This is the second line and I am trying to
see
if it wraps by itself without a VBCRLF!"

' Set the text for the txtCompanyName control.
.SetToolText Me.Client, "CompanyName - I am the CompanyName control." &
vbCrLf & "This is the second line!"

' Set the text for the txtContactName control.
' .SetToolText Me.txtContactName, "Contact Name - I am the ContactName
control." & vbCrLf & "This is the second line!"

' Set the text for the SelectACustomer ListBox control.
' .SetToolText Me.lstSelectACustomer, "SelectACustomer - I am the
SelectACustomer ListBox control."

' Set the text for the FindACustomer Combo control.
' .SetToolText Me.cboFindACustomer, "FindACustomer - I am the
FindACustomer Combo control."

' Set the text for the Image control.
'.SetToolText Me.Image01, "Image - I am the Image01 control." & vbCrLf
&
"This is the second line!"

' Set the text for the Line control.
'.SetToolText Me.Box01, "Line - I am the Box01 control." & vbCrLf &
"This is the second line!"

' Set the text for the txtCustomerID label.
' .SetToolText Me.CustomerID_Label, "I am the CustomerID Label." &
vbCrLf
& "This is the second line!"

' Set the text for the CompanyName label.
'   .SetToolText Me.CompanyName_Label, "I am the CompanyName Label." &
vbCrLf & "This is the second line!"

' Set the text for the ContactName label.
'  .SetToolText Me.ContactName_Label, "I am the ContactName Label." &
vbCrLf & "This is the second line!"

' Set the text for the SelectACustomer label.
'  .SetToolText Me.Select_a_Customer_Label, "I am the Select a Customer
Label." & vbCrLf & "This is the second line!"

' Set the text for the FindACustomer label.
'  .SetToolText Me.Find_a_Customer_Label, "I am the Find a Customer
Label." & vbCrLf & "This is the second line!"


' Set the text for the Notes label.
'  .SetToolText Me.Lablel_Notes, "I am the Notes Label." & vbCrLf & "This
is the second line!"

' Set the text for the NOTES TextBox control.
' .SetToolText Me.txtNotes, "I am the Notes control."

' Set the text for the Notes label.
' .SetToolText Me.Toggle43, "I am the Toggle Button." & vbCrLf & "This
is
the second line!"

' Set the text for the Notes label.
' .SetToolText Me.Check46, "I am the CheckBox Control." & vbCrLf & "This
is the second line!"

' Set the text for the Notes label.
'   .SetToolText Me.Option44, "I am the Option Button." & vbCrLf & "This
is
the second line!"

' Set the text for the Header label.
'    .SetToolText Me.LabelHeader, "I am the Header Label."
' Set the text for the Footer label.
'    .SetToolText Me.LabelFooter, "I am the Footer Label"


End With

' Fill in our NOTES unbound TextBox
'Me.txtNotes = "Move your Mouse over the any of the controls to see the
Custom Tooltips." & vbCrLf
'Me.txtNotes = Me.txtNotes & "Try moving the Mouse over the ListBox." &
vbCrLf
'Me.txtNotes = Me.txtNotes & "This works even if the ListBox does not have
the focus!"
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.
TTip.Cleanup
' Release our reference to our class
Set TTip = Nothing

End Sub

--
Regards


Patrick Stubbin


[QUOTE="Stephen Lebans"]
Not sure what to tell you Patrick. Since the sample form works in your
MDB
but your own form does not then obvioulsy you have not implemented the
Tooltips class correctly. Post all of the code behind your form so I can
have a peek to see what you left out.

--

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

Guest

thanks

u were right

fixed
--
Regards


Patrick Stubbin


Stephen Lebans said:
Without even going through your code I thought the comments in the source
code state that you must setfocus to a TextBox control, not a Combo or
ListBox control. Modify your logic to setfocus to a TextBox control and see
if that solves your issue.

Let me know.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
Patrick Stubbin said:
here it is:

there is also a mcro being run on the 'on open'... but it just maximises
the
form

Option Compare Database
Option Explicit
' Copyright Lebans Holdings 1999 Ltd.

' Declare an object of type our toolTip class
Dim TTip As clsToolTip
'
Private Sub cboFindACustomer_MouseMove(Button As Integer, Shift As
Integer,
X As Single, Y As Single)
'Debug.Print "mouseMove:" & "X:" & X & " y:" & Y
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click


DoCmd.GoToRecord , , acFirst

Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click

End Sub
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click


DoCmd.GoToRecord , , acPrevious

Exit_Command18_Click:
Exit Sub

Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click

End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click


DoCmd.GoToRecord , , acNext

Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click

End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click


DoCmd.GoToRecord , , acLast

Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub
Private Sub Command21_Click()
On Error GoTo Err_Command21_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command21_Click:
Exit Sub

Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click

End Sub
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click


DoCmd.Close

Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub
Private Sub Combo24_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "
Code:
 = " & Str(Nz(Me![Combo24], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

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.Combo24.SetFocus

With TTip
' Creat the tooltip window
Call .Create(Me)

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

.SetToolTipTitle "CUSTOM TOOLTIPS", 0

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

' Set the ToolTip text for the controls on this Form

' Set the text for the txtCompanyName control.
'.SetToolText txtCustomerID, "I am the CustomerID control." & vbCrLf &
"This is the second line and I am trying to see if it wraps by itself
without
a VBCRLF!"
' .SetToolText Me.Combo24, "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
ABCDEFGHIJKLMNOPQRSTUVWZXXABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
I am the CustomerID control. This is the second line and I am trying to
see
if it wraps by itself without a VBCRLF!"

' Set the text for the txtCompanyName control.
.SetToolText Me.Client, "CompanyName - I am the CompanyName control." &
vbCrLf & "This is the second line!"

' Set the text for the txtContactName control.
' .SetToolText Me.txtContactName, "Contact Name - I am the ContactName
control." & vbCrLf & "This is the second line!"

' Set the text for the SelectACustomer ListBox control.
' .SetToolText Me.lstSelectACustomer, "SelectACustomer - I am the
SelectACustomer ListBox control."

' Set the text for the FindACustomer Combo control.
' .SetToolText Me.cboFindACustomer, "FindACustomer - I am the
FindACustomer Combo control."

' Set the text for the Image control.
'.SetToolText Me.Image01, "Image - I am the Image01 control." & vbCrLf
&
"This is the second line!"

' Set the text for the Line control.
'.SetToolText Me.Box01, "Line - I am the Box01 control." & vbCrLf &
"This is the second line!"

' Set the text for the txtCustomerID label.
' .SetToolText Me.CustomerID_Label, "I am the CustomerID Label." &
vbCrLf
& "This is the second line!"

' Set the text for the CompanyName label.
'   .SetToolText Me.CompanyName_Label, "I am the CompanyName Label." &
vbCrLf & "This is the second line!"

' Set the text for the ContactName label.
'  .SetToolText Me.ContactName_Label, "I am the ContactName Label." &
vbCrLf & "This is the second line!"

' Set the text for the SelectACustomer label.
'  .SetToolText Me.Select_a_Customer_Label, "I am the Select a Customer
Label." & vbCrLf & "This is the second line!"

' Set the text for the FindACustomer label.
'  .SetToolText Me.Find_a_Customer_Label, "I am the Find a Customer
Label." & vbCrLf & "This is the second line!"


' Set the text for the Notes label.
'  .SetToolText Me.Lablel_Notes, "I am the Notes Label." & vbCrLf & "This
is the second line!"

' Set the text for the NOTES TextBox control.
' .SetToolText Me.txtNotes, "I am the Notes control."

' Set the text for the Notes label.
' .SetToolText Me.Toggle43, "I am the Toggle Button." & vbCrLf & "This
is
the second line!"

' Set the text for the Notes label.
' .SetToolText Me.Check46, "I am the CheckBox Control." & vbCrLf & "This
is the second line!"

' Set the text for the Notes label.
'   .SetToolText Me.Option44, "I am the Option Button." & vbCrLf & "This
is
the second line!"

' Set the text for the Header label.
'    .SetToolText Me.LabelHeader, "I am the Header Label."
' Set the text for the Footer label.
'    .SetToolText Me.LabelFooter, "I am the Footer Label"


End With

' Fill in our NOTES unbound TextBox
'Me.txtNotes = "Move your Mouse over the any of the controls to see the
Custom Tooltips." & vbCrLf
'Me.txtNotes = Me.txtNotes & "Try moving the Mouse over the ListBox." &
vbCrLf
'Me.txtNotes = Me.txtNotes & "This works even if the ListBox does not have
the focus!"
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.
TTip.Cleanup
' Release our reference to our class
Set TTip = Nothing

End Sub

--
Regards


Patrick Stubbin


[QUOTE="Stephen Lebans"]
Not sure what to tell you Patrick. Since the sample form works in your
MDB
but your own form does not then obvioulsy you have not implemented the
Tooltips class correctly. Post all of the code behind your form so I can
have a peek to see what you left out.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
I have loaded the tool tip generator from lebans and copied the forms
and
modules into an exisitng database of mine.

when i open the ftooltip form exam ples, it works ok..

But when i incorporte them into one of my forms and change things as
appropriate (i think at least).   when i open the form , the following
error
mesage appears
RUNTIME ERROr 91 , object varialbe or with block variable not set.


any thoughts
--
Regards


Patrick Stubbin[/QUOTE][/QUOTE][/QUOTE]
 

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