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  ?


0
Ange
1/28/2008 5:58:48 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
1032 Views

Similar Articles

[PageSpeed] 46

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:
Departure:DateAdd("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
0
fredg
1/28/2008 6:40:44 PM
On Mon, 28 Jan 2008 19:58:48 +0200, "Ange Kappas" <angekap@hol.gr> 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]
0
John
1/28/2008 7:07:32 PM
Reply:

Similar Artilces:

Can I change the calendar year beginning date?
Our fiscal year runs July 1 thru June 30 of each year. I need to track attendance, gas cards, etc for monthly reports. I have a HUGE table with a gazillion queries and reports for each one. I need one report to reflect quarterly output for our fiscal year as stated above. Can I make this report do that? Thank you! Create a query to use as the source for your report. In query design, type this into the Field row: FinYear: DateAdd("m", -6, [InvoiceDate]) replacing InvoiceDate with the name of your date field. This yields 2007 for all dates in the 2007/2008 financial year...

Date Formatting when Concantenating
I have a simple question. I have a cell that has date that looks lik this: 10/15/1999 14:34 When I use the concantenate feature my date looks like this: 36448.6073611111 I tried to format the call every which way - but I cannot get it t look the original. Feeling really silly for even asking.. thanks all for your help -- Message posted from http://www.ExcelForum.com Hi bleu808! Use: ="Today is "&TEXT(TODAY(),"mm/dd/yyyy hh:mm") -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au "bleu808 >" <<bleu808.189yij...

Show a date 30 days out
I have a feild that I would like to show what the date would be in 30 days for a feild with a date in it [Sold Date]. Sold Date feild would be 1 Jan 07 so the feild would show 30 Days later 31 Jan 07. I did =[Sold date]+30 and it did not work Thanks how about dateadd: dateadd("d", 30, [Sold Date]) -- steve. "KAnoe" <KAnoe@discussions.microsoft.com> wrote in message news:DE9BDDAE-5C84-4A52-8185-DAB6C3167E7A@microsoft.com... >I have a feild that I would like to show what the date would be in 30 days > for a feild with a date in it [Sold Date]. > ...

How OMPM Scanner (offscan) Filter by Access/Modified Date ?
Hello, I have problem to inventory excel files on very big file server, but I believe there are so many documents we no longer need to maintain. I want to skip files if the access date or modified date longer than 6 month, but don't see the OMPM providing feature about it. I currently running OMPM since 2 weeks ago and running out of time for reporting to my manager. Please help me, this is my critical assignment. -- Eldi Munggaran ...

Dates in fomula showing as whole number
I have a fomula in a cell that takes the name of a person (from cell 2B), their License number (from another cell 2C)and the Date that License Expires (From cell 2D). The expire date in "2D" is either the word "none" or a date that that persons license needs to be renewed. Those instructors with "None" come out in the calculated field fine, however the ones with dates come back as whole numbers, Example 8/6/10 shows 40396. any help will be appreciated Hi, You need to change the format of that cell or column, highlight the cell or the column, right click o...

Adding Contacts Folder as Address Book in Exchange Server
I am trying to add my contacts folder to my address book in Outlook XP and don't see the Tools, Options I used to see in Outlook 2000. How can I add this folder to my address book? Is that an option you can turn on or off for a profile in Exchange Server? Thanks!! -- Remove 'spam' from email address to contact me directly Right click on your Contacts folder, go to properties, outlook address book. Can you tick the box there? If not, go to tools, e-mail accounts, view/change address books, and make sure you have the Outlook Address Book option there. Then try right-clicking...

Line Chart with dates in 5 day working week only
Hi, Trying to format a chart so that only the 5 working days of the week are displayed on the x axis. The source data only has the five days (e.g. 05/09/2005 down to 09/09/2005 and then on to 12/09/2005 down to 16/09/2005 etc etc) So I have missed out the weekend dates. When I create the line chart however, the weekend dates appear automatically and just show no point on the chart, therefore there is a longer line between Fridays and Mondays!! Hope this makes sense. Does anyone have any ideas on how to change this? I have tried looking at Tools-options-chart and cannot seem to turn...

Adding an "I'm out of the Office" Message
Re Outlook Express. I can't find anywhere on the index about how to send one of those "I will be out of the office from July blah blah to August blah blah." Anyone help, please? thanks-- Richard Hi - This is a group to support Outlook from the Office group of programs. Outlook Express is a part of Internet Explorer and is a quite different program, despite its similar name.. You will probably get a faster and more expert answer if you post this to an Outlook Express news group. Try posting in one of these newsgroups: microsoft.public.windows.inetexplorer.ie5.outlookexp...

How to get only the year in the date format in Access
How to get only the year in the date format I.e in the table in need to display only year E.g 2005 - should be display " 05" automatically Custom format the cell as: yy -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "yanu" <yanu@discussions.microsoft.com> wrote in message news:14CE9F60-F7B9-467A-8C16-71088C31BEBA@microsoft.com... > How to get only the year in the date form...

date/time formatting
I download a csv report from a web based program. Everything works great but the date comes through as "Jul 21 2009 1:51pm". I do not need the time in my report. I have tried reformatting the cells, tried to copy to a new file with the cells already formatted to "7/21/09", opening the cell format using the F2 key and deleting the time (time will still not be formatted correctly). The only way I get get just the time is to retype every cell. What am I doing wrong? I am using Excel 2002 SP3 TIA, Cindy When data is downloaded from the web, a lot of "other&quo...

Adding a button with a function on protected sheets.
How do i add a button to 'reset/clear' the data on a worksheet that is protected and uses VLookup data (from another worksheet). Everyday this table will have data chosen from combo boxes or manually entered in allowable editable fields and at the end of the day after the files is saved, I need to clear that data for use on the next day. How is this Reset button applied with allowable edit ranges, VLookup data and a protected worksheet? Thanks There's several ways to do this. 1. Instead of straight vlookups, use =IF(ISBLANK(VLOOKUP(....)),"",VLOOKUP(....)) wher...

Copy/paste range of rows between 2 dates...
Hi! I have a sheet called data which act as a database. The column A has the dates. In order to create customized chart in a userform, for different range of data(i.e from column D, G and M...), I'd like to select a range of rows that are between 2 dates and create the charts accordingly. Or copy to range to another sheet and then create the charts. I am not so advanced in VBA and any help would be greatly appreciated. Thanks! Greg ** Posted via: http://www.ozgrid.com Excel Templates, Training, Add-ins & Business Software Galore! Free Excel Forum http://www.ozgrid.com/forum *** Hi ...

Calculating dates #3
Can anyone tell me what I should use (in the way of helper cells) to take any date (mm/dd/yyyy) and turn it into that same month and day for specific year? For instance, turn... 10/12/2009 into 10/12/2010 and 4/6/1998 into 4/6/2010 I'm trying to determine anniversary date based on start date and do it starting in 2010. TIA -- Jordon Try this: =3DDATE(2010,MONTH(A1),DAY(A1)) Assuming your date is in A1. Hope this helps. Pete On Jan 5, 5:35=A0pm, Jordon <jordon@REMOVE~THISmyrealbox.com> wrote: > Can anyone tell me what I should use (in the way of helper cells) > to tak...

how do I format cells to change date and time to just date
I want to format a column that contains date and time and I want it to show just the date and not the time. Going into format and clicking on the date and changing doesnt work. Probably the cells aren't really dates, but text. You can check with the ISTEXT() function. If they are text, formatting doesn't have any effect. -- Kind regards, Niek Otten Microsoft MVP - Excel "bondam" <bondam@discussions.microsoft.com> wrote in message news:F4D61EC1-30E2-4723-89E1-F47B545818EE@microsoft.com... >I want to format a column that contains date and time and I want it t...

Adding GAL users into a custom form
Hi, I have created a custom form, and am required to add a series of approvers. What I am trying to achieve is: * Add users from my GAL into a text field, so that when the form is sent, they do not get initially CC'ed the form. Is this achievable, and if so, how do I do it (if you could help by including any appropriate code, that would be great). Regards, Rick ...

Non AD emails going to 1 user
I have an Exchange 2003 server running on SBS 2003 the issues is one user is getting all the emails sent to him that look like they are coming from his domain. For example his email is user@mydomain.com but in his inbox he is getting XYZ@mydomain.com but XYZ is not in the AD or has a email box set up on this server. Why is getting this non AD email and how can I stop it. Thanks in advance Are you sure it's not a SPAM where the spammer may have simply put in 123abc@mydomain.com and BCC it to all possible conceivable names @mydomain.com?? R Green "LaOVis" <LaOVis@discuss...

Calculate age as of a date certain
Employee benefit enrollment requires the age of each employee as of a specific date, such as 1/1/2005. Given the date of birth, how would this be calculated? -- Joe S. Hi see: http://www.cpearson.com/excel/datedif.htm#Age -- Regards Frank Kabel Frankfurt, Germany "Joe S." <JoeS@discussions.microsoft.com> schrieb im Newsbeitrag news:0EC4F9E5-2E60-448A-A107-7B085BC764C5@microsoft.com... > Employee benefit enrollment requires the age of each employee as of a > specific date, such as 1/1/2005. Given the date of birth, how would this be > calculated? > -- > Joe ...

Conditional formatting a date range
If I have a column of dates that are manual entered what is the formula to conditionally format them based on a date range of three months before the current date to the current date and another three months after the current date to the current date? Assume the dates are in column A, starting with A1. Highlight all the dates, with A1 as the active cell, and click on Format | Conditional Formatting. In the dialogue box you should select Formula Is rather than Cell Value Is and then enter this formula: =3DAND(A1>=3DTODAY()-91,A1<=3DTODAY()) Click on the Format button and choose the ...

Date/Time stamp in Memo Field
Hi all..is it possible to programmatically insert Now() when text in a Memo field becomes edited? Thanks for all help! If it has to be entered directly in the memo field tetxbox: Private Sub MemoFieldName_AfterUpdate() If IsNull(Me.MemoFieldName.OldValue) Then Me.MemoFieldName = Now & " " & Me.MemoFieldName Else Me.MemoFieldName = Left(Me.MemoFieldName, Len(Me.MemoFieldName.OldValue)) & " " & Now & " " & Right(Me.MemoFieldName, Len(Me.MemoFieldName) - Len(Me. MemoFieldName.OldValue)) End If Me.Dirty = False End...

Add Actual End Date to Resolved Cases view
Hi We would like to add the actual end date to the Case General Tab or possibly to the Resolved Cases and/or My Resolved Cases view. I know that the Actual End Date is available on the Service Activity and Case Resolution but this field is not available for the Case. Any workaround for this? Thanks Mark ...

due dates #5
thanks alot guys I have it working now this will save me a ton of scanning over dates with a visual que I have 8 pages with 6 rows of due dates on each pag -- canma ----------------------------------------------------------------------- canman's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1459 View this thread: http://www.excelforum.com/showthread.php?threadid=26223 Glad to hear that, canman ! Thanks for the feedback -- Rgds Max xl 97 --- Please respond in thread xdemechanik <at>yahoo<dot>com ---- "canman" <canman.1czh20@excelforum-n...

Update cell based on date range
Hey guys! I was wondering if I could get some help here. I would lik to update a cell based on a date range. For example, I would like t update the value of a cell to the value of another cell if the curren date is between July 1st and July 10th. However, if the date i outside the date range, I want the value for that cell to not b updated, and be the previous value. Can anyone give me an example a to how I would do this? Thanks!! -- deversol ----------------------------------------------------------------------- deversole's Profile: http://www.excelforum.com/member.php?action=geti...

Tooltips stop working when adding ON_UPDATE_COMMAND_UI handler
After adding a ON_UPDATE_COMMAND_UI handler(this is the only one I have), tooltips for all toolbars stop working. I'm using this handler to disable the button it handles under certain conditions. Does anyone know why this occurs and a fix? Possibly there is a better mechanism for disabling the button, if so, what? Thanks, Drew > After adding a ON_UPDATE_COMMAND_UI handler(this is the only one I have), > tooltips for all toolbars stop working. I'm using this handler to disable > the button it handles under certain conditions. Does anyone know why this > occurs ...

Saving a file as the "date" it was created
I have a load of spreadsheets that I need to file in the same folder. The problem is each one has the same filename. Does anyone know how to save a file as the date that it was created on thus saving me having to go through 100's of files and do it manually. Thanks Dave Woodgate Activeworkbook.SaveAs Filename:=Format(Now,"yyyymmdd hhmmss")&" "&Activeworkbook.Name -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Dave" <dave.woodgate@gmail.com> wrote in message news:1147856944.197931.244350@i40g2000cwc.googlegroups....

Adding row without messing things up.
Hi all If I have 9 rows of data and then a row 10 containing formulas, is i possible to add another row of data after row9 and have the formula ro move automatically to row 11 without having to copy and paste it Thanks alot -- Iotre ----------------------------------------------------------------------- Iotrez's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3736 View this thread: http://www.excelforum.com/showthread.php?threadid=57056 Assum you had numbers in A1:A9 and in A10 you had =SUM(A1:A9) If you insert a row above row 10 by selecting A10 and Insert&...