Set Date Code Probem

D

DS

I have this code but I don't know where to stick it. Do you stick it on
the before Update propery of the textbox or .....where?
Thanks
DS

dim selday as integer, DateSelected as variant
selday = val(me.activecontrol.value)
dateselected = DateSerial(Year(Me![firstdate]), Month(Me![firstdate]),
selday)
 
D

Douglas J. Steele

I wouldn't use ActiveControl in this case: I'd use the actual name of the
control that holds the date.

It would go in the AfterUpdate event of the textbox.
 
D

DS

Douglas said:
I wouldn't use ActiveControl in this case: I'd use the actual name of the
control that holds the date.

It would go in the AfterUpdate event of the textbox.
Douglas,
why not active control? I have 42 controls that I would have to
include, it could get long!
Thanks
DS
 
D

DS

Douglas said:
I wouldn't use ActiveControl in this case: I'd use the actual name of the
control that holds the date.

It would go in the AfterUpdate event of the textbox.
Douglas,
Just tried it. Doesn't work. The textbox that I'm trying to fill is
called DateSelected. Right?
Thanks
DS
 
D

DS

DS said:
Douglas,
Just tried it. Doesn't work. The textbox that I'm trying to fill is
called DateSelected. Right?
Thanks
DS
I got it Douglas, Now I understand! Thank you for your patience!
DS
 
Top