R
Rod
All,
I have this code in a module, I got it from Dev Ashish http://www.mvps.org/access/. I have modified it a little bit. The ToolTip will now give the name of the RecordSource and the Field name. This works great but I only want to show this tooltip when the user hold the CTRL key down. Right now it works great as it is in the OnCurrent so I do not need to add it to each control on the form. Is there any why I can check to see if the use has the CTRL key pressed then the tooltip will be the RecordSource.FieldName otherwise I want the default ToolTip, what I built to display.
TIA,
Rodger
Public Sub sShowToolTip(frm As Form)
Dim ctl As Control, i As Integer, myTip
On Error Resume Next
For Each ctl In frm.Controls
With ctl
myTip = frm.RecordSource & "." & .Name
.ControlTipText = myTip
End With
Next ctl
Set ctl = Nothing: Set frm = Nothing
End Sub
'And then on my OnCurrent for a form I have . . . . .
Private Sub Form_Current()
Call sShowToolTip(Me)
End Sub
I have this code in a module, I got it from Dev Ashish http://www.mvps.org/access/. I have modified it a little bit. The ToolTip will now give the name of the RecordSource and the Field name. This works great but I only want to show this tooltip when the user hold the CTRL key down. Right now it works great as it is in the OnCurrent so I do not need to add it to each control on the form. Is there any why I can check to see if the use has the CTRL key pressed then the tooltip will be the RecordSource.FieldName otherwise I want the default ToolTip, what I built to display.
TIA,
Rodger
Public Sub sShowToolTip(frm As Form)
Dim ctl As Control, i As Integer, myTip
On Error Resume Next
For Each ctl In frm.Controls
With ctl
myTip = frm.RecordSource & "." & .Name
.ControlTipText = myTip
End With
Next ctl
Set ctl = Nothing: Set frm = Nothing
End Sub
'And then on my OnCurrent for a form I have . . . . .
Private Sub Form_Current()
Call sShowToolTip(Me)
End Sub