Code a date one week from another date

Bobp3114

Member
Local time
Tomorrow, 10:07
Joined
Nov 11, 2020
Messages
62
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.
 
actually you only need 1 field, [ReceivedDate] and the other is Calculated using a query, use the query as Recordsource of your form.

Select [receivedDate], DateAdd("ww", 1, [receivedDate]) As DeliveryDate From YourTableName;
 
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.
As noted in previous responses, you do not need to store the calculated "DueDate" in a table. It is possible to do so, and there may be specific requirements for doing so, but we can't know that without further details.

In an unbound control on the form, or in a report, you can display the calculated "DueDate" using the syntax in either Post #2, Post #3 or Post #4. I would lean towards the DateAdd method.

That form or report control would have as its control source:

= DateAdd("ww", 1, [receivedDate])

With more specifics about the context, other possibilities might occur to someone.
 
Here's a bunch of sample date functions.

 
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.
So long as your date is stored in a numeric field (normally a DATE), you can use simple addition. If you are storing the date in a STRING field, this becomes a very different problem. So to confirm, this is stored as a number, not a string?
 

Users who are viewing this thread

Back
Top Bottom