[AccessD] Form Validation

Ryan W wrwehler at gmail.com
Sat Oct 29 20:24:40 CDT 2022


Yeah the docs mention you can use Forms!Form1!Text0 etc.   I could simply
make the Function Len(Forms!MyForm!MyField)>0 but that locks it down a bit
as far as flexibility.

I suppose I could make a string

s = "Forms!" & Me.Name & rst!FieldToScrutinize

z = chr(34) & Replace(rst!Function, "<fldval>", s) & chr(34)

eval(z)


perhaps?






On Sat, Oct 29, 2022 at 8:19 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:

> On 30 Oct 2022 at 10:52, Stuart McLachlan wrote:
>
> > EVAL() is a totally different thing. All it can work with are values
> > and operators. It knows nothing about Object models such as Forms and
> > controls. .
>
> I was mistaken.
> It DOES know about object models. But it needs a fully qualified object
> reference.
> It just can't evaluate  the reference "me".
>
> This works:
> 'MsgBox Eval("Len(Forms!Form1!Text0) > 0")
> this doesn't:
> MsgBox Eval("Len(Me!Text0) > 0")
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list