Eval() function ?? How to work ?

C

chuaby

Hi

i have the following code :

If not IsNull(Me.NFunc) Then
func = Me!NFunc
retval = eval(func)
End If


where i hope eval could replace the statement :

retVal = Validations.CheckDate(Me.ActiveControl.Value)

which is working fine.

The problem is that i put the string
"Validations.CheckDate(Me.ActiveControl.Value)"
in a field call NFunc

May i know how can i get the eval work ?

I have tried

eval(Validations.CheckDate(Me.ActiveControl.Value))

the function is triggered but the error message said the return value
from Checkdate is not valid

eval("Validations.CheckDate(Me.ActiveControl.Value)")

error is "validation" function cannot be found.

I have defined Validations as a module.

for some help please

Thank you in advance

Best Regards
Boon Yiang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top