Use the Now Function to get a date say one week in the future (2 Viewers)

Bobp3114

Member
Local time
Tomorrow, 10:00
Joined
Nov 11, 2020
Messages
62
I have received great help for this post (
I have a form in which we enter a date, say for when we receive an order say 21/08/2024. I wish to have the entering of that date trigger a textbox entry for a date that is say, one week more.
Thanks guys
Now how would I do it using the Now Function to get a date say one week in the future? This to happen when the form (frmRepReport) is opened
 
To get a date in the future, you'll use the DateAdd() function. For example:
Code:
DateAdd("d",7,Date())
 
Please remember, the function NOW() returns date and time. Integer portion is the date, decimal portion is time.
DATE() returns just the integer date.

Hopefully this avoids issues for you when your "Date" (stored as a date and time) doesn't match the "Date" (date only) entered.
 
What Mark_ said.

?Date()
1/17/2025

?Now()
1/17/2025 2:12:47 PM

?Date() = Now()
False
 
Thanks, you guys are unbelievable! Answers in less than an hour.
I have used Me.txtNextContactDate = DateAdd("d", 7, Date) and works fine
 
Thanks, you guys are unbelievable! Answers in less than an hour.
I have used Me.txtNextContactDate = DateAdd("d", 7, Date) and works fine
Goal here is to answer not just your question, but the other ones you didn't know you needed to ask! 😁
 
TBH when it is just days, I just prefer to use a number +7 or -7 depending on which way you are going.
I use DateAdd for the not so simple date intervals.
 
you could also add 1 week:

Me.txtNextContactDate = DateAdd("ww", 1, Date)
 

Users who are viewing this thread

Back
Top Bottom