PC Review


Reply
Thread Tools Rate Thread

Control Code - Plus One Day

 
 
Bob V
Guest
Posts: n/a
 
      14th Jul 2007


If I had a Button what On Click code would I need to increase the date 1 day
The text box [tbStartDate1]
Thanks for any help.....Bob


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q2hlZXNlX3doaXo=?=
Guest
Posts: n/a
 
      14th Jul 2007
Hi Bob,

Assumming you want to increase the date in the same text box where the date
appears:
____________

Sub cmdDatePush_click()

Me.tbStartDate1 = DateAdd("d", 1, Me.tbStartDate1)

End Sub
____________

You'll need to add an error handler, as per standard operating procedure...

Hope that helps,
CW

"Bob V" wrote:

>
>
> If I had a Button what On Click code would I need to increase the date 1 day
> The text box [tbStartDate1]
> Thanks for any help.....Bob
>
>
>

 
Reply With Quote
 
JK
Guest
Posts: n/a
 
      14th Jul 2007
Hi Bob,

A simple Me.tbStartDate1 = Me.tbStartDate1 +1 will do

Regards
Jacob

"Bob V" <(E-Mail Removed)> wrote in message
news:Ot$(E-Mail Removed)...
|
|
| If I had a Button what On Click code would I need to increase the date 1
day
| The text box [tbStartDate1]
| Thanks for any help.....Bob
|
|


 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      14th Jul 2007
Thanks Jk havent heard from you for a while, Its my bet this year on the Mel
Cup , we go 1/2s
Bob
"JK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Bob,
>
> A simple Me.tbStartDate1 = Me.tbStartDate1 +1 will do
>
> Regards
> Jacob
>
> "Bob V" <(E-Mail Removed)> wrote in message
> news:Ot$(E-Mail Removed)...
> |
> |
> | If I had a Button what On Click code would I need to increase the date 1
> day
> | The text box [tbStartDate1]
> | Thanks for any help.....Bob
> |
> |
>
>



 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      14th Jul 2007
Oops Jacob your code did not work, Cheese Whiz did Thanks Cheese

"JK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Bob,
>
> A simple Me.tbStartDate1 = Me.tbStartDate1 +1 will do
>
> Regards
> Jacob
>
> "Bob V" <(E-Mail Removed)> wrote in message
> news:Ot$(E-Mail Removed)...
> |
> |
> | If I had a Button what On Click code would I need to increase the date 1
> day
> | The text box [tbStartDate1]
> | Thanks for any help.....Bob
> |
> |
>
>



 
Reply With Quote
 
JK
Guest
Posts: n/a
 
      15th Jul 2007
You're on

"Bob V" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Thanks Jk havent heard from you for a while, Its my bet this year on the
Mel
| Cup , we go 1/2s
| Bob
| "JK" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Hi Bob,
| >
| > A simple Me.tbStartDate1 = Me.tbStartDate1 +1 will do
| >
| > Regards
| > Jacob
| >
| > "Bob V" <(E-Mail Removed)> wrote in message
| > news:Ot$(E-Mail Removed)...
| > |
| > |
| > | If I had a Button what On Click code would I need to increase the date
1
| > day
| > | The text box [tbStartDate1]
| > | Thanks for any help.....Bob
| > |
| > |
| >
| >
|
|


 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      15th Jul 2007
Cheese, I do have a problem with this, the date format should be 12-May-07
but when I use this control to change the date I am getting 12/5/2007, I
have tried this ,but not successful.............Thanks Bob

Me.tbDayNo = DateAdd("d", 1, Me.tbDayNo)
tbDayNo.value = Format("dd-mmm-yy")

"Cheese_whiz" <(E-Mail Removed)> wrote in message
news:A2F55951-0475-4644-B15C-(E-Mail Removed)...
> Hi Bob,
>
> Assumming you want to increase the date in the same text box where the
> date
> appears:
> ____________
>
> Sub cmdDatePush_click()
>
> Me.tbStartDate1 = DateAdd("d", 1, Me.tbStartDate1)
>
> End Sub
> ____________
>
> You'll need to add an error handler, as per standard operating
> procedure...
>
> Hope that helps,
> CW
>
> "Bob V" wrote:
>
>>
>>
>> If I had a Button what On Click code would I need to increase the date 1
>> day
>> The text box [tbStartDate1]
>> Thanks for any help.....Bob
>>
>>
>>



 
Reply With Quote
 
JK
Guest
Posts: n/a
 
      15th Jul 2007
It does not make sense as in case of adding (or subtracting) days the two
are the same. Access keeps dates as Double type number whereby 31 Dec 1899=1
and today (15/07)=39,278. Fractions are part of a day, eg 0.5=12 hours etc

However, the important part is that you got it to work :-)

Regards
Jacob

"Bob V" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
| Oops Jacob your code did not work, Cheese Whiz did Thanks Cheese
|
| "JK" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Hi Bob,
| >
| > A simple Me.tbStartDate1 = Me.tbStartDate1 +1 will do
| >
| > Regards
| > Jacob
| >
| > "Bob V" <(E-Mail Removed)> wrote in message
| > news:Ot$(E-Mail Removed)...
| > |
| > |
| > | If I had a Button what On Click code would I need to increase the date
1
| > day
| > | The text box [tbStartDate1]
| > | Thanks for any help.....Bob
| > |
| > |
| >
| >
|
|


 
Reply With Quote
 
JK
Guest
Posts: n/a
 
      15th Jul 2007
Bob,

The Format() function produces a *string* - Format(Date,"dd-mmm-yy") will
produce the string "15-May-07". To apply format to a date use:

Me.tbDayNo.Format="dd-mmm-yy"

Regards
Jacob


"Bob V" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
| Cheese, I do have a problem with this, the date format should be 12-May-07
| but when I use this control to change the date I am getting 12/5/2007, I
| have tried this ,but not successful.............Thanks Bob
|
| Me.tbDayNo = DateAdd("d", 1, Me.tbDayNo)
| tbDayNo.value = Format("dd-mmm-yy")
|
| "Cheese_whiz" <(E-Mail Removed)> wrote in message
| news:A2F55951-0475-4644-B15C-(E-Mail Removed)...
| > Hi Bob,
| >
| > Assumming you want to increase the date in the same text box where the
| > date
| > appears:
| > ____________
| >
| > Sub cmdDatePush_click()
| >
| > Me.tbStartDate1 = DateAdd("d", 1, Me.tbStartDate1)
| >
| > End Sub
| > ____________
| >
| > You'll need to add an error handler, as per standard operating
| > procedure...
| >
| > Hope that helps,
| > CW
| >
| > "Bob V" wrote:
| >
| >>
| >>
| >> If I had a Button what On Click code would I need to increase the date
1
| >> day
| >> The text box [tbStartDate1]
| >> Thanks for any help.....Bob
| >>
| >>
| >>
|
|


 
Reply With Quote
 
Bob V
Guest
Posts: n/a
 
      15th Jul 2007
Me.tbDayNo = DateAdd("d", -1, Me.tbDayNo)

tbDayNo.value = Format([tbDayNo], "dd-mmm-yy")

Thanks Jacob fixed it with this code
But Can I have an error catch on it
If tbDayNo = "" -1 , Now
Meaning if tbDayNo is Blank -1 from Now Date
Does that make sense!
Regards Bob

"JK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Bob,
>
> The Format() function produces a *string* - Format(Date,"dd-mmm-yy") will
> produce the string "15-May-07". To apply format to a date use:
>
> Me.tbDayNo.Format="dd-mmm-yy"
>
> Regards
> Jacob
>
>
> "Bob V" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> | Cheese, I do have a problem with this, the date format should be
> 12-May-07
> | but when I use this control to change the date I am getting 12/5/2007, I
> | have tried this ,but not successful.............Thanks Bob
> |
> | Me.tbDayNo = DateAdd("d", 1, Me.tbDayNo)
> | tbDayNo.value = Format("dd-mmm-yy")
> |
> | "Cheese_whiz" <(E-Mail Removed)> wrote in message
> | news:A2F55951-0475-4644-B15C-(E-Mail Removed)...
> | > Hi Bob,
> | >
> | > Assumming you want to increase the date in the same text box where the
> | > date
> | > appears:
> | > ____________
> | >
> | > Sub cmdDatePush_click()
> | >
> | > Me.tbStartDate1 = DateAdd("d", 1, Me.tbStartDate1)
> | >
> | > End Sub
> | > ____________
> | >
> | > You'll need to add an error handler, as per standard operating
> | > procedure...
> | >
> | > Hope that helps,
> | > CW
> | >
> | > "Bob V" wrote:
> | >
> | >>
> | >>
> | >> If I had a Button what On Click code would I need to increase the
> date
> 1
> | >> day
> | >> The text box [tbStartDate1]
> | >> Thanks for any help.....Bob
> | >>
> | >>
> | >>
> |
> |
>
>



 
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
Re: Can I code HTML code straight to Webbrowser control? ib.dangelmeyr@googlemail.com Microsoft Dot NET 0 23rd Sep 2009 09:49 AM
adding runat=server to a control on aspx page, don't cause the IDE to add the control to the code behind z. f. Microsoft ASP .NET 1 25th Jun 2004 04:15 AM
Re: adding runat=server to a control on aspx page, don't cause the IDE to add the control to the code behind Phil Winstanley [Microsoft MVP ASP.NET] Microsoft ASP .NET 0 24th Jun 2004 01:37 PM
How to address control within templated custom control from code behind Earl Teigrob Microsoft ASP .NET 2 8th Jun 2004 08:18 PM
RE: How to access page code behind from User Control code behind Tian Min Huang Microsoft Dot NET 4 23rd Mar 2004 01:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:30 AM.