Autopopulation of field based on another.

Monstermechanic

Registered User.
Local time
Today, 01:23
Joined
Jan 31, 2006
Messages
16
The trouble that I am having is that I wish to Autopopulate a "Due date" based on a "notification Date" that is not todays date. I believe that I need to use the Date Add function however the expression is unknown to me.....
 
Access help - search on DateAdd.
 
Been there done that and have an XXL teeshirt.
 
This is what's shown in my Access help. Perhaps yours is different.

The following table lists examples of expressions that use the DateAdd function to add date and time values.

You can use these expressions in calculated controls (calculated control: A control that is used on a form, report, or data access page to display the result of an expression. The result is recalculated each time there is a change in any of the values on which the expression is based.) on forms, reports, and data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.).

Expression Description
=DateAdd("d", -10, [PromisedDate]) Displays a date that is 10 days before the value of the PromisedDate field.
=DateAdd("m", 1, "31-Jan-03") Displays a date that is a month after 31-Jan-03, so the expression will evaluate to 28-Feb-03.
=DateAdd("m", 1, "31-Jan-04") Displays a date that is a month after 31-Jan-04, and since 2004 is a leap year, the expression will evaluate to 29-Feb-04.
=DateAdd("q", 3, [PromisedDate]) Displays a date that is three quarters after the value of the PromisedDate field; for example, if the value of the PromisedDate field is 18-Jun-03, the expression will evaluate to 18-Mar-04.
=DateAdd("h", 3, [ArrivalTime]) Displays a time that is three hours after the value of the ArrivalTime field.

You can use these expressions in a calculated field in a query.

Expression Description
DueDate: DateAdd("q", 3, [PromisedDate]) Displays in the DueDate field a date that is three quarters after the value of the PromisedDate field.
PickUpTime: DateAdd("h", 3, [ArrivalTime]) Displays in the PickUpTime field a time that is three hours after the value of the ArrivalTime field.
 
Thanks for your assist. This works great. Unfortunately I did not have the full versions of VBA on this "work" computer. Thanks again for the assist......
 

Users who are viewing this thread

Back
Top Bottom