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

Access MOUSEOVER event on forms

Status
Not open for further replies.

StellaIndigo

IS-IT--Management
Sep 19, 2002
118
GB
Hi

I need to do to emulate the MOUSEOVER event on an access form. Similar to mouse over on a Web page. Is there any way to do this or am I going to have to do it with data pages.

Ta



There are 10 types of people in the world. Those that understand binary and those that don't.
 
Did you try using the "Mouse Move" event? It detects when the mouse is over various controls.
 
Yeah, I did. The only way I thought of doing it was to have a global last_object, by reference, so when I mouse over an control I (for example change the forecolor)

last_object.forecolor = myBlack
self.forecolor = myRed
last_object = self

put a null object check around it and object type check, say for labels or images only. However my vb skills aren't that good to create this code.


There are 10 types of people in the world. Those that understand binary and those that don't.
 
Hmmm....Here's a way to change labels on a form. Add the following function to form:

Function HighLightObject(Frm As Form, Optional ObjName As Variant)

Dim Ctrl As Control

On Error Resume Next ' If error, oh well.
If IsMissing(ObjName) Then
If LastObject <> &quot;&quot; Then
Set Ctrl = Frm(LastObject)
Ctrl.FontBold = False
Ctrl.ForeColor = vbBlack
LastObject = &quot;&quot;
End If
Else
Set Ctrl = Frm(ObjName)
Ctrl.FontBold = True
Ctrl.ForeColor = vbRed
LastObject = ObjName
End If

End Function

Declare LastObject variable on form:

Dim LastObject As String

Then on the Mouse Move event of the label you want to change, set it to:

=HighLightObject([Form],&quot;lblTitle&quot;)

where &quot;lblTitle&quot; is the name of the label. This will change that only that label. To remove formatting, call the same function without an object name, on the Mouse Move event of the Detail or Form Header event (or any other object), like:

=HighLightObject([Form])

Might not be the best way, and it's not foolproof. If user moves mouse real fast, or labels are tightly spaced, but may get you started.
 
thanks i'll give it a go

There are 10 types of people in the world. Those that understand binary and those that don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top