date and time picker

G

Guest

I would like the data and time picker to open on the current month when the
form is opened. At the moment is opens on the default date. Can anyone tell
me how to do this in VB behind the form please
 
T

Tim Ferguson

I would like the data and time picker to open on the current month
when the form is opened. At the moment is opens on the default date.
Can anyone tell me how to do this in VB behind the form please

It depends which variety of datepicker you mean: most of them have a .Value
property you can write to. RTFM.

Tim F
 
G

Guest

Private Sub DTPicker1_Updated(Code As Integer)
DTPicker1.Value = Now()
End Sub

This is the code I have put in to set the value, the date is correct but the
initial month that is displayed is still older than the current month.
 
T

Tim Ferguson

Private Sub DTPicker1_Updated(Code As Integer)
DTPicker1.Value = Now()
End Sub

This is the code I have put in to set the value, the date is correct
but the initial month that is displayed is still older than the
current month.


It looks like this is an event that fires _after_ the user has done
something to the datepicker... would it not be more sensible to set it when
the thing loads. I image the OnUpdated event is better suited to reading
the value.

Hope that helps


Tim F
 
R

RD

I would like the data and time picker to open on the current month when the
form is opened. At the moment is opens on the default date. Can anyone tell
me how to do this in VB behind the form please

If you're using the MS DateTimePicker control it's default value is the date and
time you created it. I never found a good way to change it and ended up not
using it. Look here for an Access based Date Picker control:
http://www.glump.net/dokuwiki/software/microsoft_access_date_picker

Good luck,
RD
 

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

Top