Set Tool Tip from VBA in Access 2010 Applications


Public Function fnSetToolTip()

 Dim sRTO As String
 Dim sACCDE As String

 sACCDE =
  Mid(Application.CurrentProject.Name,
  Len(Application.CurrentProject.Name) - 5,
  Len(Application.CurrentProject.Name))

   If SysCmd(acSysCmdRuntime) Then
    sRTO = "RunTimeOnly"
   Else
    sRTO = "Access 2010"
   End If

 Forms![Form1].[oleObject].ControlTipText = "Default Value Set"
 Forms![Form1].[oleObject].ControlTipText =
  "Customer Name " &
  Environ("COMPUTERNAME") & " " &
  Environ("USERNAME") & " " &
  sRTO & " " &
  sACCDE & " "

End Function