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

  • Thread starter =?ISO-8859-15?Q?Oliver_Gr=E4ser?=
  • Start date
?

=?ISO-8859-15?Q?Oliver_Gr=E4ser?=

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
 
?

=?ISO-8859-15?Q?Oliver_Gr=E4ser?=

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
 
W

Wolfram Jahn

Oliver said:
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
 
?

=?ISO-8859-15?Q?Oliver_Gr=E4ser?=

Wolfram said:
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?
 
S

Sue Mosher [MVP-Outlook]

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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