Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Future Month 1

Status
Not open for further replies.

lbunch

Programmer
Sep 5, 2006
120
US
I have a text box txtColors that when it is updated I need the txtDate to reflect the next month and day being the 10th day.

I change txtcolors today I need txtdate to reflect 10/10/2006. Is there a way to do this?
 
txtDate = DateSerial(Year(Now()), 1 + Month(Now()), 10)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
But I think it is going to be a little more difficult.

I have 12 text boxes for Jan - Dec and based upon which one is revised then that month will change the txtdate.

Say, I revise Nov, then the date will be 12/10/2006.

 
Is this the same problem you were asking about in thread707-1279744?

I was about to suggest:
Code:
txtdate = DateSerial(Year(DateAdd("m", 1, Now())), Month(DateAdd("m", 1, Now())), "10")
including the dateadd in the Year section to account for December roling over into January, but then I tried your suggestion (with a December Date) and found that it works! Thanks for that, PH.

->
star.gif


[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
lcan4,

Just replace the NOW with the reference to what Date is to be used.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Thanks - but if I have a text box for November and it is not November when I change that column how does that code know I need to update the date to December. I may be updating November but it may still be September. Does that make sense?


The other post is a whole different roblem. I think this one is simpler.
 
Like this:

DateSerial(Year(DateAdd("m", 1, 12 / 1 / 2006)), Month(DateAdd("m", 1, 12 / 1 / 2006)), "10")

I get 10/10/1900...

Am I doing it right???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top