[AccessD] Eval Function... (or a better way)

jeff.embury at mac.com jeff.embury at mac.com
Tue Jan 31 10:12:20 CST 2006


I have a form I'm constructing that has twenty one check boxes on it... twenty one labels, twenty one of a lot of things... and I'm trying to alter there values in a simplified way by hopefully using the Eval function - but it's not working as advertised.

The Scene: Microsoft Access 2003 in vba code...

Check box names: Check1, Check2, Check-etc.

Function to turn all check's 'on' or 'off':

Function TurnMeOn(bWhichWay as boolean)
   Dim n as integer
   Dim s as string

   n = 1
   Do While n < 21
      s = "form!formname.check" & trim(str(n)) & " = bWhichWay"
      Eval (s)
      n = n + 1
   loop
End Function

================This doesn't' work=============== (sigh!)

...if fact hardly nothing works with the Eval function as I see it...

Microsoft plainly states that the Eval function can call a user defined function - but if I create a function called... let's say "TESTIT()" and then use Eval("TESTIT()") it pukes...


Any help or is there a much more brilliant solution I'm unaware of?




More information about the AccessD mailing list