If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding Dates
I have a field with arrival date then a field with days and another field
with departure date. I enter a date in the arrival date field, then I put in how many days as a number in the days field and using a Macro command on exit I want the departure date to show automatically the arrival date plus the days. How do I do it ? |
#2
|
|||
|
|||
Adding Dates
On Mon, 28 Jan 2008 19:58:48 +0200, Ange Kappas wrote:
I have a field with arrival date then a field with days and another field with departure date. I enter a date in the arrival date field, then I put in how many days as a number in the days field and using a Macro command on exit I want the departure date to show automatically the arrival date plus the days. How do I do it ? You don't. Access is a database, not a spreadsheet. All you need do is store (in your table) the [ArrivalDate] and the [Days]. Then whenever you need the Departure date, simply calculate it. In a query: DepartureateAdd("d",[Days],[ArrivalDate]) Directly on a form or in a report, using an unbound text control: =DateAdd("d",[Days],[ArrivalDate]) -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Adding Dates
On Mon, 28 Jan 2008 19:58:48 +0200, "Ange Kappas" wrote:
I have a field with arrival date then a field with days and another field with departure date. I enter a date in the arrival date field, then I put in how many days as a number in the days field and using a Macro command on exit I want the departure date to show automatically the arrival date plus the days. How do I do it ? Set the Control Source of the departure date command to =DateAdd("d", [NumberOfDays], [ArrivalDate]) You should almost surely NOT store all three values in your table, since the departure date can be calculated from the other two. If you store all three then you'll be at risk of data anomalies such as ArrivalDate = 1/27/2008, NumberOfDays = 100, and DepartureDate = 2/1/2008. One of these must be wrong but there's no immediate way to tell which! John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|