Group:  Microsoft Access ยป microsoft.public.access.activexcontrol
Thread: incement a date field

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

incement a date field
"mikeslaptop" <me[ at ]here.com> 03.03.2006 03:12:45
I am using the ms calendar control.
I can read the selected date from it, and I want to add a day to the value I
just read in a way that allows access to automatically change the value I
captured into the next month or year as necessary.

ie// i would read the date of march 31, 2006 x = calendar1.value
i add a day to the variable of type date, --somehow--- x = x +1 day
then the field returns april 01, 2006

thanks folks



Re: incement a date field
Tony Toews <ttoews[ at ]telusplanet.net> 03.03.2006 04:59:09
"mikeslaptop" <me[ at ]here.com> wrote:

[Quoted Text]
>I am using the ms calendar control.

See the Calendar Tips page at my website
http://www.granite.ab.ca/access/calendars.htm

There could, likely will, be lots of version problems when you go to
distribute the MSCal.OCX..

One alternative is MonthCalendar is a completely API generated Month
Calendar derived directly from the Common Control DLL. There are
links to several downloadable calendar forms at my website. As these
are forms you can also do anything with them you want.

You can also use the calendar form which comes in the Access <insert
your version here> Developers Handbook by Litwin/Getz/Gilbert,
publisher Sybex www.developershandbook.com. These books are well
worth spending money. Every time I open one I save the price of the
book.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Re: incement a date field
Tony Toews <ttoews[ at ]telusplanet.net> 03.03.2006 05:00:32
"mikeslaptop" <me[ at ]here.com> wrote:

[Quoted Text]
>I am using the ms calendar control.
>I can read the selected date from it, and I want to add a day to the value I
>just read in a way that allows access to automatically change the value I
>captured into the next month or year as necessary.
>
>ie// i would read the date of march 31, 2006 x = calendar1.value
>i add a day to the variable of type date, --somehow--- x = x +1 day
>then the field returns april 01, 2006

See DateAdd in the VBA help.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Re: incement a date field
"mpg" <mgardner[ at ]assuredsoftware.com> 03.03.2006 14:40:58
oh man. are you kidding? there's actually a dateadd function.
i was sucessfully incrementing the time by adding #12:30:00 AM# to it, but i
couldnt figure out the date.

also- thanks for the tips, i'll look into them and maybe another control.
(one with an onclick event would be good).

mike g


"Tony Toews" <ttoews[ at ]telusplanet.net> wrote in message
news:f7jf025mj4moin6qu6v16jkpsn7pdgeqmn[ at ]4ax.com...
[Quoted Text]
> "mikeslaptop" <me[ at ]here.com> wrote:
>
>>I am using the ms calendar control.
>>I can read the selected date from it, and I want to add a day to the value
>>I
>>just read in a way that allows access to automatically change the value I
>>captured into the next month or year as necessary.
>>
>>ie// i would read the date of march 31, 2006 x = calendar1.value
>>i add a day to the variable of type date, --somehow--- x = x +1 day
>>then the field returns april 01, 2006
>
> See DateAdd in the VBA help.
>
> Tony
> --
> Tony Toews, Microsoft Access MVP
> Please respond only in the newsgroups so that others can
> read the entire thread of messages.
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm


Re: incement a date field
Tony Toews <ttoews[ at ]telusplanet.net> 03.03.2006 20:12:12
"mpg" <mgardner[ at ]assuredsoftware.com> wrote:

[Quoted Text]
>oh man. are you kidding? there's actually a dateadd function.
>i was sucessfully incrementing the time by adding #12:30:00 AM# to it, but i
>couldnt figure out the date.

Actually you could've just added 1 to the date to get the next date.
But that requires some knowledge about how the date is stored
internally. DateAdd makes it quite clear to the next person to
understand that you are doing.

>also- thanks for the tips, i'll look into them and maybe another control.
>(one with an onclick event would be good).

Actually I'm advocating using either a form or the API call as there
is then no need to distribute a control.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net