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 / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Eval() syntax problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Winnetou - 09 Jan 2005 11:43 GMT
Hi,

I am using Eval() to call a public function fTest() located in form
module frmTest.

The following code runs fTest() only once:
Call Eval(Chr$(34) & Forms("frmTest").fTest("aaa") & Chr$(34)) 'Once

When I add string identifiers to the code, fTest is called twice:
strfrm = "frmTest": strArg = "aaa"
strTmp = "Forms(" & Chr$(34) & strfrm & Chr$(34) & ").fTest(" &
Chr$(34) & strArg & Chr$(34) & ")"
Call Eval(strTmp) 'Twice

Where
Public Function fTest(X)
Beep: Debug.Print CStr(X)
End Function

I don't understand what causes the function to be run twice in the
second case. Thanks for any suggestions.

Mark
Kagsy - 12 Jan 2005 10:36 GMT
Mark

I can only imagine it is because you are referring to an
object, i.e. subForm in the Eval string which needs to be
evaluated. Does it run twice if you set the value of the
form control to a variable?

Kagsy
>-----Original Message-----
>Hi,
[quoted text clipped - 22 lines]
>
>.
 
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.