W
Wally
Hi,
I need to pass a control's name on a form to a sub
procedure. I can do this part, but in the Sub I need to
change this controls value. I'm trying to use the passed
control.name string something like this and of course it
doesn't work.
SUB UpdateMe(controlname as string, controlvalue as date)
if controlvalue > date() then
(here is the part that don't work)
form("myformname").controlname = date()
end if
END SUB
Then I call the Sub from the AfterUpdate event of the
control.
Call UpdateMe(me.control_1.name, me.control_1.value)
The name of the control is getting to the Sub but I just
can't use it to refer back to it to change it's value.
My code is much more complex than this example and I'm
wanting to do away with redundant code by not doing this
in the AfterUpdate event module of many controls.
Thanks for any tips anyone can suggest on this.
Wally
I need to pass a control's name on a form to a sub
procedure. I can do this part, but in the Sub I need to
change this controls value. I'm trying to use the passed
control.name string something like this and of course it
doesn't work.
SUB UpdateMe(controlname as string, controlvalue as date)
if controlvalue > date() then
(here is the part that don't work)
form("myformname").controlname = date()
end if
END SUB
Then I call the Sub from the AfterUpdate event of the
control.
Call UpdateMe(me.control_1.name, me.control_1.value)
The name of the control is getting to the Sub but I just
can't use it to refer back to it to change it's value.
My code is much more complex than this example and I'm
wanting to do away with redundant code by not doing this
in the AfterUpdate event module of many controls.
Thanks for any tips anyone can suggest on this.
Wally