PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Form Programming Is it possible to use 2 dtpicker controls to determine the same property?

Reply

Is it possible to use 2 dtpicker controls to determine the same property?

 
Thread Tools Rate Thread
Old 11-06-2006, 06:29 PM   #1
=?ISO-8859-15?Q?Oliver_Gr=E4ser?=
Guest
 
Posts: n/a
Default Is it possible to use 2 dtpicker controls to determine the same property?


Hello again,

I hope I don't start stepping on someone's nerves by asking these
question, but it really seems I'm too stupid for this...

I created an customized appointment item of which I only want to use my
P. 2. To imitate the start / end menu of the standard appointment page,
I put a DTPicker control on my page and assigned the start/end values to
this control - works fine, once I inserted the item_open function that
initializes the controls (Thanks to the outlookcode.com team)

Now, I thought it'd be much nicer if the controls were really the same
way as in the original appointment page 1. That is, one control for the
day and one for the time. So I put 2 DTP for each start/end value on the
form. I use the dtpcustom format for all and assign ddd, dd:MM:yy to
one and hh:mm to the other. Fine so far. The only bad thing is that if I
really open one such form, changing the date in the first control really
changes the date, but changing the time in the second control has no
effect at all.

I suppose I can work around this by writing a function that extracts the
time from on control, the date from the other, creates a date object
from those, and assignes this to .Start and .End. But this would be such
a messy way, and I'm sure this problem must apply to many persons -
anyone got any hints?

Thanks,

Oliver
  Reply With Quote
Old 12-06-2006, 01:00 AM   #2
=?ISO-8859-15?Q?Oliver_Gr=E4ser?=
Guest
 
Posts: n/a
Default Re: Is it possible to use 2 dtpicker controls to determine the sameproperty?

Sorry for bothering - it turned out that the "Use Property - Value"
field was empty, and it was impossible to choose 'Value'. A reboot
resolved this.

I think I understand now that both DTPicker keep a full Date set, i.e.
can't be reduced to either Date or Time. However, this seems to apply
for more or less everything I assign to the Start/End Properties (I also
created a dropdown with 08:15; 08:30 etc), even if the possible values
of my fields contain no date, it still seems to be somewhere hidden. I
decided to stick for now with one DTPicker, but if anyone knows how to
assign only the date / time part of a Date to a control, I'd still like
to know...

Cheers

Oliver

Oliver Gräser schrieb:
> Hello again,
>
> I hope I don't start stepping on someone's nerves by asking these
> question, but it really seems I'm too stupid for this...
>
> I created an customized appointment item of which I only want to use my
> P. 2. To imitate the start / end menu of the standard appointment page,
> I put a DTPicker control on my page and assigned the start/end values to
> this control - works fine, once I inserted the item_open function that
> initializes the controls (Thanks to the outlookcode.com team)
>
> Now, I thought it'd be much nicer if the controls were really the same
> way as in the original appointment page 1. That is, one control for the
> day and one for the time. So I put 2 DTP for each start/end value on the
> form. I use the dtpcustom format for all and assign ddd, dd:MM:yy to
> one and hh:mm to the other. Fine so far. The only bad thing is that if I
> really open one such form, changing the date in the first control really
> changes the date, but changing the time in the second control has no
> effect at all.
>
> I suppose I can work around this by writing a function that extracts the
> time from on control, the date from the other, creates a date object
> from those, and assignes this to .Start and .End. But this would be such
> a messy way, and I'm sure this problem must apply to many persons -
> anyone got any hints?
>
> Thanks,
>
> Oliver

  Reply With Quote
Old 12-06-2006, 06:20 PM   #3
Wolfram Jahn
Guest
 
Posts: n/a
Default Re: Is it possible to use 2 dtpicker controls to determine the sameproperty?

Oliver Gräser wrote:
> but if anyone knows how to
> assign only the date / time part of a Date to a control, I'd still like
> to know...


Hi Oliver,

usually in VB the Date/Time is fractional value, where the integral part
holds the date information and the fractional part holds the time portion.

E.g., adding 1 to a date/time var increments the day by one.

HTH, Wolfram
  Reply With Quote
Old 13-06-2006, 08:22 AM   #4
=?ISO-8859-15?Q?Oliver_Gr=E4ser?=
Guest
 
Posts: n/a
Default Re: Is it possible to use 2 dtpicker controls to determine the sameproperty?

Wolfram Jahn schrieb:
> Oliver Gräser wrote:
>> but if anyone knows how to assign only the date / time part of a Date
>> to a control, I'd still like to know...

>
> Hi Oliver,
>
> usually in VB the Date/Time is fractional value, where the integral part
> holds the date information and the fractional part holds the time portion.
>
> E.g., adding 1 to a date/time var increments the day by one.
>
> HTH, Wolfram


Yep, that helps, thanks. So CDate(Fix(Now)+1#/3) is today 8am, right? IS
that the standard way?
  Reply With Quote
Old 13-06-2006, 12:20 PM   #5
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Is it possible to use 2 dtpicker controls to determine the same property?

Now() returns the current date/time, so adding 1/3 day to Now will give you 8 a.m. only if it's now midnight.

Date() returns the current day with the time set for midnight.

DateAdd() is another way add a certain number of hours, minutes, etc. to a date/time value.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Oliver Gräser" <oliver.graeser@uni-konstanz.de> wrote in message news:OrK2oorjGHA.836@TK2MSFTNGP02.phx.gbl...
> Wolfram Jahn schrieb:
>> Oliver Gräser wrote:
>>> but if anyone knows how to assign only the date / time part of a Date
>>> to a control, I'd still like to know...

>>
>> Hi Oliver,
>>
>> usually in VB the Date/Time is fractional value, where the integral part
>> holds the date information and the fractional part holds the time portion.
>>
>> E.g., adding 1 to a date/time var increments the day by one.
>>
>> HTH, Wolfram

>
> Yep, that helps, thanks. So CDate(Fix(Now)+1#/3) is today 8am, right? IS
> that the standard way?

  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off