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
 

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

Similar Threads

Calendar Question 6
Too Many Dates 1
Dateserial same every time 3
Dateserial function 1
Need help modifying code 0
I am going mad!! 10
changing formulas across worksheets 8
Expected end of statement 12

Top