Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2007

Tip: Looking for answers? Try searching our database.

MouseOver and MouseOut scheme.  Eval is not running pseudo-event handlers.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard - 31 Jan 2007 20:00 GMT
Can't figure out why EVAL isn't.

My form has detail section named Detail containing a text box named
MyTextControl.

Using properties window
Detail.OnMouseMove is set to  =OverAndOut("Detail")
MyTextControl.OnMouseMove is set to =OverAndOut("MyTextControl")

Over and Out is coded as such:
'====================================
Dim ControlNameMouseOver As String

Function OverAndOut(ControlName As String)
 Dim OutFunction As String
 Dim OverFunction As String
 Dim rc As Integer

 If ControlName <> ControlNameMouseOver Then
   OutFunction = ControlNameMouseOver & "_MouseOut()"

   On Error Resume Next
   rc = Eval(OutFunction)

   ControlNameMouseOver = ControlName

   OverFunction = ControlNameMouseOver & "_MouseOver()"
   rc = Eval(OverFunction)
 End If
End Function

Function MyTextControl_MouseOver() As Long
 MsgBox ("Over happened")
End Function

Function MyTextControl_MouseOut() As Long
 MsgBox ("Out happened")
End Function
'====================================

The OverAndOut code runs, but neither MyTextControl_MouseOver nor
MyTextControl_MouseOut runs.

Any reason why?

TIA,
Richard
Richard - 01 Feb 2007 05:05 GMT
> Can't figure out why EVAL isn't.
>
[quoted text clipped - 43 lines]
> TIA,
> Richard

It appears that a NameSpace is needed

   NameSpace = "Forms!" & "[" & Me.Name & "]."

   OutFunction = NameSpace & ControlNameMouseOver & "_MouseOut()"
   OverFunction = NameSpace & ControlNameMouseOver & "_MouseOver()"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.