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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Control Tip Text with VBA

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
I have the following code in the OnCurrent of the subform so that it will show me the text in the strItemDescription field when I mouse over. However, it is only showing me the text in the first record on the subform, regardless of which record I have the mouse over. Please tell me what I need to change to make it change for the current record.

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

Thank you
Dawn
 
MouseOver does not a current record make.

It isn't a current record until the record is selected by clicking on it or scrolling to it. You have bumped into a frequently lamented limitation of continuous forms view. Most formatting applies only to the current record, playing havoc on other records. "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
hmm, I guess perhaps I wasn't clear. I don't think you can do what you want. As far as I know it can't be done.

In Access, formatting of controls applies to the current record. All controls in a continuous form view are formatted like the current record. Mousing over a record will not make the record Current so you see the ControlTip for the Current record (in your case the first record) regardless of which record you are 'mousing'. Hope that makes sense.

Also, hoping you don't apply the Roman consequence to the bearer of bad news... :)

What do you do? I'd suggest adding the field to your form so that it is displayed for each record. That will probably be faster for your users anyway, rather than having to mouse over to get the information that they need. "The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top