Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Tip Text in a form 1

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
Hi there, in Access 2000, I would like to know how to make the control tip text read the data that is currently in the field. In other words, what I want to do, is hold the mouse over the field and have it show me everything in that field, since alot of the data in the field is not veiwable unless the user scrolls. I tried putting the name of the field in the control tip text property but that didn't work. Any ideas?

Thank you.

Dawn
 
VBA would be the safe bet, so u know what you are changing and when.

Dim str_Test As String
str_Test = "THIS is a Test of Tool Tip Text"
Me.Command45.ControlTipText = str_Test

;-)
Steve Medvid
"IT Consultant & Web Master"
 
I see.. I did not have time to figure out where the code should go, but this may provide a clue...


Private Sub Text10_Change()
Me.Text10.ControlTipText = IIf(IsNull(Me.Text10.Value), "", Me.Text10.Value)
End Sub

Private Sub Text10_Enter()
Me.Text10.ControlTipText = IIf(IsNull(Me.Text10.Value), "", Me.Text10.Value)

End Sub

Private Sub Text10_Exit(Cancel As Integer)
Me.Text10.ControlTipText = IIf(IsNull(Me.Text10.Value), "", Me.Text10.Value)
End Sub
Steve Medvid
"IT Consultant & Web Master"
 
Well you helped me figure it out!!! Thanks. Here is what I did. On the OnCurrent event of the sub form, I put

If (IsNull([strItemDescription])) Then
Me.strItemDescription.ControlTipText = "Enter Item Description"
Else
Me.strItemDescription.ControlTipText = Me.strItemDescription.Value
End If

Thank you again
 
Ooops, one little problem, the control tip text is putting the text of the same record regardless of which one I am over with the mouse. I think this is because I have it in the OnCurrent event.
 
Yes. The ON CURRENT event is form (record) related, not FIELD related.

I know of no way of programmatically altering the controltip text for a field. However, you might try this little trick. Place this code in your text field's ON GOT FOCUS event:

Code:
Dim RegLength as integer
RegLength = Screen.ActiveControl.Length
Screen.ActiveControl.LENGTH = 1440 * 3

This will change the LENGTH of your text field to 3 inches (measurements in TWIPS, 1440 to an inch) when it has the focus.

On the LOST FOCUS event, set the length back to what it was:
Code:
Screen.Activecontrol.Length = RegLength

If you really want to save coding, make these calls in to functions, and simply call the functions anytime you have a text field that you want to enlarge while it has the focus, and shrink back when you leave it.

 
hello, I am following your thread, and indeed, he doesnt perform a refresh of the data.
I am checking how to resolve this interesting thing.
 
Thanks Steve, well that artical confirmed that what I wanted to do wouldn't work in continous forms. Here is something interesting though. I noticed that when I took out the control tip code, and put it back to normal, that the tool tip now comes up with the text in the feild, the correct text for EACH record. Doing nothing, gets me what I want. Hmmmm.

Dawn
 
I can't figure this one out...it's probably really simple for ya, but I can't seem to do it. During a query, I need to use an IIF function to display a new column titled "Amount Owing". If the PaidAmt is not equal to the PledgeAmt, I need to be able to display the amount owing (PledgeAmt less PaidAmt). What would the IFF function look like?

 
Hi there, SLCVikings, I think you meant to post this as a new thread. The new column would look like this:

AmountOwing:IIF([PaidAmt]=[PledgeAmt],0,[pledgeAmt]-[paidAmt])

In the properties of the field, you may need to change the format to a number format. Also, you may need to put quotes around the 0 above, I am not sure.

Dawn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top