thanks for your continued support.
in the load event i changed tooltips icon to 0 but that didnt make any
difference to the error code.
i changed the unload event to
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.SetToolTipTitle "DATABASE SETUP", 0
TTip.Cleanup
' Release our reference to our class
Set TTip = Nothing
End Sub
and tis made no difference to the error code. Code is now stopping at
line
TTip.SetToolTipTitle "DATABASE SETUP", 0 instead of line TTip.Cleanup
:
Try setting the Icon to NONE in the form's Unload event before you
call
the
Cleanup on the class.
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.
thanks for reply stephen,
ive started getting a runtime error 91 now. Please can you help?
the code breaks at TTip.Cleanup in the unload event.
here is the code for my form
Option Compare Database
Option Explicit
' Declare an object of type our toolTip class
Dim TTip As clsToolTip
Public Sub CheckCompanyDetails()
On Error GoTo Err_CheckCompanyDetails
Dim CompanyName As String
Dim bustype As String
Dim Address As String
Dim Address2 As String
Dim City As String
Dim County As String
Dim PostCode As String
Dim PNumber As String
Dim MNumber As String
Dim FNumber As String
Dim Email As String
Dim Web As String
CompanyName = DLookup("CompanyName1", "tblOurCompanyInfo")
bustype = DLookup("[Business Type]", "tblOurCompanyInfo")
Address = DLookup("cAddress", "tblOurCompanyInfo")
Address2 = DLookup("cAddress2", "tblOurCompanyInfo")
City = DLookup("cCity", "tblOurCompanyInfo")
County = DLookup("cCounty", "tblOurCompanyInfo")
PostCode = DLookup("PostCode", "tblOurCompanyInfo")
PNumber = DLookup("[PhoneNumber]", "tblOurCompanyInfo")
FNumber = DLookup("FaxNumber", "tblOurCompanyInfo")
MNumber = DLookup("[Mobile Number]", "tblOurCompanyInfo")
Email = DLookup("Email", "tblOurCompanyInfo")
Web = DLookup("WebSite", "tblOurCompanyInfo")
' If there is no Null values in the company details then
display
section as completed.
Form_sbfrmDatabaseSetup.cmdOpenDatabaseSetup1.ForeColor =
vbBlack
Exit_CheckCompanyDetails:
Exit Sub
Err_CheckCompanyDetails:
Select Case Err.Number
Case 94 ' Invalid Use of Null. Display section as Incomplete.
Form_sbfrmDatabaseSetup.cmdOpenDatabaseSetup1.ForeColor =
vbRed
Case Else
MsgBox Err.Number & Err.Description, ,
CurrentDb.Properties("AppTitle")
Resume Exit_CheckCompanyDetails
End Select
End Sub
Private Sub Address_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub businesstype_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub cAddress2_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub City_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub CompanyName_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub County_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub Email_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub FaxNumber_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub MobileNumber_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub PhoneNumber_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub PostCode_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
End Sub
Private Sub Web_Site_LostFocus()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
CheckCompanyDetails
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.CompanyName.SetFocus
With TTip
' Creat the tooltip window
Call .Create(Me)
' Set the tooltip window to show for 5 secs
.DelayTime = 5000
.SetToolTipTitle "DATABASE SETUP", 1
' ToolTip text colors
.ForeColor = vbBlack
.BackColor = RGB(252, 255, 220)
' Set the text for the control.
.SetToolText Me.CompanyName, "Type in here your company name!"
.SetToolText Me.BusinessType, "Type in here what your business
does!
eg.
builder"
.SetToolText Me.Address, "Type in here the first line of your
business
addrress"
.SetToolText Me.cAddress2, "Type in here the second line of your
business address"
.SetToolText Me.City, "Type in here the City of your companys
address"
.SetToolText Me.County, "Type in here the County of your companys
address"
.SetToolText Me.PostCode, "Type in here the Post Code of your
companys
address"
.SetToolText Me.PhoneNumber, "Type in here your companys main
phone
number"
.SetToolText Me.MobileNumber, "Type in here your companys mobile
number
if you have one"
.SetToolText Me.FaxNumber, "Type in here your companys fax number
if
you
have one"
.SetToolText Me.Email, "Type in here your companys main email
addres
sif
you have one"
.SetToolText Me.Web_Site, "Type in here your companys web site if
you
have one"
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.
TTip.Cleanup
' Release our reference to our class
Set TTip = Nothing
End Sub
:
This functionality is exposed via the SetToolTipTitle method.
To set one of the predefined Icons:
TTip.SetToolTipTitle "Icon Test", 3
With WinXP and higher, you can also pass a handle to an Icon (
hIcon)
instead of one of the constants.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
i've downloaded a tooltip database from
http://www.lebans.com/
which
creates
baloon type tooltips, from KB article
http://support.microsoft.com/default.aspx?scid=kb;en-us;119991.
Ive got it all working but i just need to know how to get the
icons
onto
the
baloons.
this is a section from the code but i just cant make sense of it,
ive
tried
adding the code TTM_SETTITLE=2 but knowing happens
'// ToolTip Icons (Set with TTM_SETTITLE)
Private Const TTI_NONE = 0
Private Const TTI_INFO = 1
Private Const TTI_WARNING = 2
Private Const TTI_ERROR = 3