Página 1 de 1

Access control properties at runtime using macro ?? Expert needed!

Publicado: Lun Jun 15, 2009 5:47 pm
por ChrisGillard
Hi,
I have 12 TDatePicker Controls on my form.
They are names oDatePicker1 to oDatePicker12.
I want to set their values in a loop so would like to write something like
this ...... can this be done ??
&( "::oDatePicker" + alltrim( str( n ) ) + ":dValue" ) := dPeriodEndDate
This results in a GPF Access code 000005.
I suspect my problem it is to do with the :: object reference or something ?
The nearest I can get is this code that does work and works as expected in
the loop
&( "logdisplay(" + str( n ) + ")" )
My alternative approach would be to add all the oDatePicker controls to an
array and access them using
aControls[n]:dValue .... I'm sure this would work.
But I would like to know if its possible to do using the macro &.
Thanks
Chris Gillard