Show prior week in the Date Picker

O

Olly

I'm using the date picker to allow user to select the date. However,
they need to enter a large amount of data. So I was wondering is it
possible to force the prior week to be displayed, at the beginning of
a new month?

For example at the beginning of Feb 2010, they are entering
information for the week 25 - 31 Jan. I would like to be able to push
the calendar back by a week, and show them this date, so that they
don't need to click back to the prior month.

Thanks
Olly
 
S

Stefan Hoffmann

hi Olly,

I'm using the date picker to allow user to select the date. However,
they need to enter a large amount of data. So I was wondering is it
possible to force the prior week to be displayed, at the beginning of
a new month?
Simply set the value of the DateTimePicker in code, e.g. something like

dtpStart.Value = DateSerial(Year(Now()), Month(Now()) - 1, 1)


mfG
--> stefan <--
 
O

Olly

hi Olly,

On 09.02.2010 17:33, Olly wrote:>

Simply set the value of the DateTimePicker in code, e.g. something like

   dtpStart.Value = DateSerial(Year(Now()), Month(Now()) - 1, 1)

mfG
--> stefan <--

I tried the code as you suggested, however this just resulted in the
01/01/2010 being inserted into the textbox. I added the code into the
"On Click" event. The textbox with the datepicker attached is called
"startDate". The resulting code follows:

Private Sub startDate_Click()
StartDate.Value = DateSerial(Year(Now()), Month(Now()) - 1, 1)
End Sub

cheers
Olly
 

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