PC Review


Reply
Thread Tools Rate Thread

Date Picker on Multipage

 
 
Shawn
Guest
Posts: n/a
 
      14th Jul 2009
How do I access a Date picker on a Multipage?
I want to assign it a value.
I have tried

frmTMF.MultiPage1.Pages.Item(DTPickerReviewDate).Value = Date
and
frmTMF.DTPickerReviewDate.Value = Date

both return error 438 - Object doesn't support this property or method
 
Reply With Quote
 
 
 
 
Shawn
Guest
Posts: n/a
 
      14th Jul 2009
Sorry needed to correct first post

How do I access a Date picker on a Multipage?
I want to assign it a value.
I have tried

frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
and
frmTMF.DTPickerReviewDate.Value = Date

first returns error 438 - Object doesn't support this property or method
second returns error 35788 - An error occured in a call to the windows date
and time picker control
 
Reply With Quote
 
EricG
Guest
Posts: n/a
 
      14th Jul 2009
This worked for me:

Me.DTPicker1.Year = Year(Date)
Me.DTPicker1.Month = Month(Date)
Me.DTPicker1.Day = Day(Date)

HTH,

Eric

"Shawn" wrote:

> Sorry needed to correct first post
>
> How do I access a Date picker on a Multipage?
> I want to assign it a value.
> I have tried
>
> frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> and
> frmTMF.DTPickerReviewDate.Value = Date
>
> first returns error 438 - Object doesn't support this property or method
> second returns error 35788 - An error occured in a call to the windows date
> and time picker control

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      14th Jul 2009
If the page is activated
Me.DTPicker1.Value = Date

If not try on change event...
Private Sub MultiPage1_Change()
If MultiPage1.SelectedItem.Caption = "Page2" Then
Me.MultiPage1.Pages(1).DTPicker1.Value = Date
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Shawn" wrote:

> Sorry needed to correct first post
>
> How do I access a Date picker on a Multipage?
> I want to assign it a value.
> I have tried
>
> frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> and
> frmTMF.DTPickerReviewDate.Value = Date
>
> first returns error 438 - Object doesn't support this property or method
> second returns error 35788 - An error occured in a call to the windows date
> and time picker control

 
Reply With Quote
 
Lemi
Guest
Posts: n/a
 
      14th Jul 2009
Hi Shawn,

Pls also see my post dd. 07.07.09 subjectatePicker control lost in 2007,
if it is relevant.

Rgds
Lemi

"Shawn" <(E-Mail Removed)> wrote in message
news:8606D9CC-7170-4F80-B11C-(E-Mail Removed)...
> Sorry needed to correct first post
>
> How do I access a Date picker on a Multipage?
> I want to assign it a value.
> I have tried
>
> frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> and
> frmTMF.DTPickerReviewDate.Value = Date
>
> first returns error 438 - Object doesn't support this property or method
> second returns error 35788 - An error occured in a call to the windows
> date
> and time picker control



 
Reply With Quote
 
Shawn
Guest
Posts: n/a
 
      14th Jul 2009
This does not work on a multipage on a userform - sorry if I was not clear on
that.
A userform with a multipage that has a date picker in it.

"EricG" wrote:

> This worked for me:
>
> Me.DTPicker1.Year = Year(Date)
> Me.DTPicker1.Month = Month(Date)
> Me.DTPicker1.Day = Day(Date)
>
> HTH,
>
> Eric
>
> "Shawn" wrote:
>
> > Sorry needed to correct first post
> >
> > How do I access a Date picker on a Multipage?
> > I want to assign it a value.
> > I have tried
> >
> > frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> > and
> > frmTMF.DTPickerReviewDate.Value = Date
> >
> > first returns error 438 - Object doesn't support this property or method
> > second returns error 35788 - An error occured in a call to the windows date
> > and time picker control

 
Reply With Quote
 
Shawn
Guest
Posts: n/a
 
      14th Jul 2009
If this repliy appears more than once I apologize - the reply button is
having issues

Me.DTPicker1.Value = Date
does not work with a multipage

Me.MultiPage1.Pages(1).DTPicker1.Value = Date
returns error 438 - Object doesn't support this property or method




"Jacob Skaria" wrote:

> If the page is activated
> Me.DTPicker1.Value = Date
>
> If not try on change event...
> Private Sub MultiPage1_Change()
> If MultiPage1.SelectedItem.Caption = "Page2" Then
> Me.MultiPage1.Pages(1).DTPicker1.Value = Date
> End If
> End Sub
>
> If this post helps click Yes
> ---------------
> Jacob Skaria
>
>
> "Shawn" wrote:
>
> > Sorry needed to correct first post
> >
> > How do I access a Date picker on a Multipage?
> > I want to assign it a value.
> > I have tried
> >
> > frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> > and
> > frmTMF.DTPickerReviewDate.Value = Date
> >
> > first returns error 438 - Object doesn't support this property or method
> > second returns error 35788 - An error occured in a call to the windows date
> > and time picker control

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      14th Jul 2009
Please read the comments along with the code...

If the page/control is *** activated *** and visible on screen
Me.DTPicker1.Value = Date

'If not try on ***change event ****...
Private Sub MultiPage1_Change()
If MultiPage1.SelectedItem.Caption = "Page1" Then
Me.DTPicker1.Value = Date + 5
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Shawn" wrote:

> If this repliy appears more than once I apologize - the reply button is
> having issues
>
> Me.DTPicker1.Value = Date
> does not work with a multipage
>
> Me.MultiPage1.Pages(1).DTPicker1.Value = Date
> returns error 438 - Object doesn't support this property or method
>
>
>
>
> "Jacob Skaria" wrote:
>
> > If the page is activated
> > Me.DTPicker1.Value = Date
> >
> > If not try on change event...
> > Private Sub MultiPage1_Change()
> > If MultiPage1.SelectedItem.Caption = "Page2" Then
> > Me.MultiPage1.Pages(1).DTPicker1.Value = Date
> > End If
> > End Sub
> >
> > If this post helps click Yes
> > ---------------
> > Jacob Skaria
> >
> >
> > "Shawn" wrote:
> >
> > > Sorry needed to correct first post
> > >
> > > How do I access a Date picker on a Multipage?
> > > I want to assign it a value.
> > > I have tried
> > >
> > > frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> > > and
> > > frmTMF.DTPickerReviewDate.Value = Date
> > >
> > > first returns error 438 - Object doesn't support this property or method
> > > second returns error 35788 - An error occured in a call to the windows date
> > > and time picker control

 
Reply With Quote
 
EricG
Guest
Posts: n/a
 
      14th Jul 2009
Actually, I placed the DTP on the second page of a multi-page control on a
user form, and the code I supplied you worked perfectly. Not sure why yours
won't work, but mine did.

It also works this way:

Me.MultiPage1.Pages("Page2").DTPicker1.Year = 2009
Me.MultiPage1.Pages("Page2").DTPicker1.Month = 7
Me.MultiPage1.Pages("Page2").DTPicker1.Day = 1



Eric

"Shawn" wrote:

> This does not work on a multipage on a userform - sorry if I was not clear on
> that.
> A userform with a multipage that has a date picker in it.
>
> "EricG" wrote:
>
> > This worked for me:
> >
> > Me.DTPicker1.Year = Year(Date)
> > Me.DTPicker1.Month = Month(Date)
> > Me.DTPicker1.Day = Day(Date)
> >
> > HTH,
> >
> > Eric
> >
> > "Shawn" wrote:
> >
> > > Sorry needed to correct first post
> > >
> > > How do I access a Date picker on a Multipage?
> > > I want to assign it a value.
> > > I have tried
> > >
> > > frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
> > > and
> > > frmTMF.DTPickerReviewDate.Value = Date
> > >
> > > first returns error 438 - Object doesn't support this property or method
> > > second returns error 35788 - An error occured in a call to the windows date
> > > and time picker control

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      14th Jul 2009
Select Page1 and then try running your code. It appears the page the control
is on must be active in order to address the control's properties.

--
Rick (MVP - Excel)


"EricG" <(E-Mail Removed)> wrote in message
news:430BC669-44A1-4AA8-AD8D-(E-Mail Removed)...
> Actually, I placed the DTP on the second page of a multi-page control on a
> user form, and the code I supplied you worked perfectly. Not sure why
> yours
> won't work, but mine did.
>
> It also works this way:
>
> Me.MultiPage1.Pages("Page2").DTPicker1.Year = 2009
> Me.MultiPage1.Pages("Page2").DTPicker1.Month = 7
> Me.MultiPage1.Pages("Page2").DTPicker1.Day = 1
>
>
>
> Eric
>
> "Shawn" wrote:
>
>> This does not work on a multipage on a userform - sorry if I was not
>> clear on
>> that.
>> A userform with a multipage that has a date picker in it.
>>
>> "EricG" wrote:
>>
>> > This worked for me:
>> >
>> > Me.DTPicker1.Year = Year(Date)
>> > Me.DTPicker1.Month = Month(Date)
>> > Me.DTPicker1.Day = Day(Date)
>> >
>> > HTH,
>> >
>> > Eric
>> >
>> > "Shawn" wrote:
>> >
>> > > Sorry needed to correct first post
>> > >
>> > > How do I access a Date picker on a Multipage?
>> > > I want to assign it a value.
>> > > I have tried
>> > >
>> > > frmTMF.MultiPage1.DTPickerReviewDate.Value = Date
>> > > and
>> > > frmTMF.DTPickerReviewDate.Value = Date
>> > >
>> > > first returns error 438 - Object doesn't support this property or
>> > > method
>> > > second returns error 35788 - An error occured in a call to the
>> > > windows date
>> > > and time picker control


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Direct-X date picker to pick date range for query =?Utf-8?B?U2xhcHB5?= Microsoft Access Macros 2 27th Sep 2006 01:07 AM
I am trying to use the Microsoft Date and Time Picker control and I am getting the following error "an error occured in a call to the windows date and time picker control" in access 2000 Ralph Malph Microsoft Access Forms 0 25th Oct 2004 07:00 PM
Date time picker setting current date at creation eyad hasan Microsoft Outlook Form Programming 2 26th Mar 2004 04:11 PM
MS Date and Time Picker Control defaults to today's date =?Utf-8?B?UmF2aQ==?= Microsoft Outlook Form Programming 1 23rd Jan 2004 03:31 PM
MS Date and Time Picker Control defaults to today's date =?Utf-8?B?UmF2aQ==?= Microsoft Outlook Program Addins 0 14th Jan 2004 06:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:23 PM.