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
860 Views

Similar Articles

[PageSpeed] 41

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:

date calcuation
how would one express 1st Monday 3 months later? given start date in a1 as 2007-06-11 adding 3 months is easy: =date(year(a10),month(a1)+3, day) but how do I make sure if that is not Monday, I grab the coming Monday? hopefully I don't macro for that Here you go, with start date in A10 (you used both A10 and A1) =DATE(YEAR(A10),MONTH(A10)+3, DAY(A10))-WEEKDAY(DATE(YEAR(A10),MONTH(A10)+3, DAY(A10))-2)+7 -- Regards, Peo Sjoblom "gs" <gs@dontMail.telus> wrote in message news:uKqAp$QrHHA.4764@TK2MSFTNGP06.phx.gbl... > how would one express 1st Monday 3 mont...

Adding hyperlinks with parameters
Hey everybody I have a batch file which needs to be run from an excel sheet with a parameter, like this: c:\1.bat myParameter But when i try to run the Hyperlink, the Excel shows an error message saying it can't open the specified file (probably because the is a space between the file and the parameter) is there any known way to run the link from the excel? On Mar 2, 12:45=A0pm, Pasha <pavel_v...@mailto.mod.gov.il> wrote: > Hey everybody > I have a batch file which needs to be run from an excel sheet with a > parameter, like this: > c:\1.bat myParameter > But when i ...

Adding Blank Rows after the last Detail of the Report
Hi All, I've used this code from Dwayne: Private Sub Report_Page() Dim intNumLines As Integer Dim intLineNumber As Integer Dim intTopMargin As Integer Dim ctl As Control Dim intLineHeight As Integer intNumLines = 12 intTopMargin = Me.Section(3).Height intLineHeight = Me.Section(0).Height For Each ctl In Me.Section(0).Controls For intLineNumber = 0 To intNumLines - 1 Me.Line (ctl.Left, intTopMargin + _ (intLineNumber * intLineHeight)) - _ Step(ctl.Width, intLineHeight), , B Next Next End Sub My report needs to print blank rows (at least...

Can v4.0 workflow determine what date today is?
My client wants an e-mail to be sent to the record owner if the Closed Date on the Opp is past. The problem here is that in order to know that today is 1 day past when the Closed Date was projected, I actually need WF to know what today is. I can’t figure out how to do that. Workflow knows all the date attributes for the entity and knows the date it was fired, but I can’t figure out how it can tell what today is, and therefore determine if today is greater than a stored date. see if it can =B4be some of help. http://mscrmsupport.wordpress.com/2007/11/20/comparing-crm-datetime-with-...

Automatically Update Date/Time in Template
I can insert a date/time in a new message if I am using Word as my editor, but then I cannot save it as a template (why you would want an auto-updating field in a message that cannot be stored as a template is another question). If I switch off Word as the editor so that I can save as a template, I cannot insert a date/time and have it auto-update. Is there a way out of this conundrum, or should I just chalk it up to another peculiarity of MS software? Thanks for any assistance. ...

Date Issue
Could someone please help me. I have attached my problem, on the click of a button, called "Date Box" i have a userform appear. i then have a textbox and a button. I would like the text box to be autopopulated with today's date, an the button to open a calandar so that this date can be changed i requested. my coding is very poor, so thats why i am asking here..... Any help would be appreciated. Cheers And +---------------------------------------------------------------- | Attachment filename: date issue.zip |Download attachment: http...

Make A Set Of Date
i have 2 sheets FOGLIO1 e FOGLIO2 in FOGLIO1 cell D2 i have the value 60 in the cell J2 i have a date, for example 27/11/2004, i colud want fill a set of date in FOGLIO2 to start in the cell G2 for every 60 month day year, for example: sheet FOGLIO2 in the cell G2 27/11/2004 in the cell G3 27/12/2004 in the cell G4 27/01/2005 in the cell G5 27/02/2005 .... in the cell BN2 27/10/2009 this macro for every data present in the column D2:D2000 and in the column J2:J2000 from FOGLIO1 when the actual date is the same in the cell G2 of sheet FOGLIO2 delete the cell G2 and skip to left the other c...

Incorrect received date
Hello, My domain controller server failed and it's systemboard was replaced by the manufacturer. We did not anticipate the date/time - Kerberos sensitivity and all systems were disconnected until we were able to synchornize the time (new server was off). Unfortunately, we were so focused on the time that did not noticed the date being off to. About 12 hrs later a user reported receiving message's with "tomorrow's" date. How bizarre? We checked the newly repaired server and there was the culprit. Upon fixing the date and resynchronizing/replicating Active Director...

outlook vcard, ad integration user properties
my boss is trying to get hix fax# in his vcard. he is using his address from the global address list I have modified his profile in active directory users and computers: I go into AD users and computers, double click on his user, go to the telephones tab, and enter his fax #. but when I did this his fax # is still not being pulled up in his outlook vcard. Does anyone know where outlook is trying to get this field from / how i can get this field into his vcard? thx ...

lost date pull down money 2001
how do i get the date pull down to work again in money 2001 register ...

ADDING A NUMBER
how do i add a number to a range of cells? I need to add 11.27 to a number of different cells each with a different number in them Put 11.27 in an empty cell, format it the same way as the numbers you want to add to, copy it, then select the numbers you want to add to and do edit>paste special and select add. -- Regards, Peo Sjoblom "Helpme" <Helpme@discussions.microsoft.com> wrote in message news:6D51344A-78E6-4377-B292-FC6C16FF6BA2@microsoft.com... > how do i add a number to a range of cells? I need to add 11.27 to a > number > of different cells e...

Search by date
Hello, I am trying to search a table by date using a combo box. I want the combo box to be populated by dates from a table, however many of the dates are listed in the table more than once. Is there a way to only display the dates in the combo box once? Thanks SELECT DISTINCT [SOME_DATE] FROM SomeTable; -- Dave Hargis, Microsoft Access MVP "wesley.allen@gmail.com" wrote: > Hello, > > I am trying to search a table by date using a combo box. I want the > combo box to be populated by dates from a table, however many of the > dates are listed in the table more ...

adding new records
I am totally new to CRM, so I hope this is really easy question: This concerns permissions.. I have a "sales" group, and with one of those people i need to be able to let them add new records on behalf of other "sales" people. Is there like a standard permission setting for it? (obviously every "sales" person can add new records if they select them selfs as the owner) thanks, Michal. Hi, By default the person who creates the record will be the owner. After record creation the person could reassign the record (manually) to another user. If all rec...

When adding attachments...
....in Outlook the following errors comes up: "Out of memory or system resources, please close some programs and try again" Quotas are fine. I have deinstalled/reinstalled Office, cleaned 'temp' areas, and many other tidbits. Any other ideas? Thanks. This might help as i had this problem with Outlook 98. Is the file you are trying to copy to attach nested in sub folders? if so try and copy the attachment to a root drive like c:\ Ignore previous email. wrong spellin if the attachment is nested in sub folders(this means you have to open different folders to get to ...

Picture Disappears When Added To Contact In Outlook 2003
Can someone help please. When I try to attach a picture to a contact in outlook 2003 immediately I double click the picture to be attached it disappears out of the outlook contact along with the placement holder in the form. Only when I right click the mouse and go remove picture do I get the placement holder back. I have looked at all the help menus but they offer no clues. Thanks TS ...

create a new worksheet when a cell has a date entered
I am trying to create a new worksheet when a cell has a date entered into it For instant in Worksheet 1 you type into cell B11 a date I would like to automaticly create a new worksheet and call it that date entered to B11 Then if I type a Date into cell B12 a new worksheet would be created and named the date entered into B12 and so on Is this out of the question See response in your other post. "Zane" wrote: > I am trying to create a new worksheet when a cell has a date entered > into it > > For instant in Worksheet 1 you type into cell B11 a date > I would l...

Adding ActiveX to dialog with wrapper
When I add an ActiveX object to a dialog using the dialog editor - right click - insert activeX object, the help on the resulting activex selection tool states that a wrapper will not be added by using this method. If you need a wrapper, it suggests using the class view. This is using Visual Studio 2005. I'm having some problems with this on an existing project. To make sure I understand the process, I created a new MFC project, added a dialog, created a class for that dialog and added a Flexgrid object using the right click method in the dialog. I then added a variable for the flexgrid...

Adding alternate columns
I work on a schedule where I record ticket count and ticket sales for each show, listed chronologically. Column A = week ending date Column B = # Tickets sold for April 5 show Column C = Ticket Revenue for April 5 show Column D = # Tickets sold for April 9 show Column E = Ticket Revenue for April 9 show Column F = # Tickets sold for April 12 show Column G = Ticket Revenue for April 12 show Column H = Total # Tickets sold for all shows Column I = Total Ticket Revenue for all shows In the Totals columns, the Total Tickets formula is "+B4+D4+F4", and the Total Revenue f...

TEXT(date)?
As you know, the function =DATEVALUE("8/22/2008") produces a date from its corresponding text representation. I want to go the OTHER way. That is, I want to take a date and produce its text representation (I'll settle for any reasonable format). How might I go about doing that? Thanks, John Your answer is in your question!! try: =TEXT(TODAY(),"dd-mm-yy") or any other reasonable date-style format -- Gary's Student "JMF" wrote: > As you know, the function > > =DATEVALUE("8/22/2008") > > produces a date from its corr...

Service pack 3 Release date
when service pack 3 will be release for project server 2007 , WSS 3.0 , MOSS 2007 ? Sam: I haven't heard anything about this yet, but now that we're past RTM, I'm sure it's on the near-term agenda. -- Gary L. Chefetz, MVP, MCT, MCTIP Business: http://www.msprojectexperts.com FAQs: http://www.projectserverexperts.com BLOG: http://www.projectserverhelp.com "Sam" <Sam@discussions.microsoft.com> wrote in message news:54675F30-43A9-413D-B3B0-50F8463BA2A5@microsoft.com... > when service pack 3 will be release for project server 2007 , WSS 3...

Adding fields from a different query
I have a form built based on a main query. How do I add more fields on that form that come from a different query? Anne A couple possibilities... Change your first query to include the extra fields. Use your second query to "feed" a form, then embed that form as a subform on your main form. Good luck! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudoco...

Adding more than three Conditions to 'Conditional Formatting'
Can i add more than three conditions to the conditional formatting presets using code? Regards [Riz] -- Rizitsu ------------------------------------------------------------------------ Rizitsu's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=15840 View this thread: http://www.excelforum.com/showthread.php?threadid=320382 Riz, as you have found out, only 3 conditions with conditional formatting. But yes you can use some code to get more than 3, try this it will change the cell color in column A when you put in one ,two, three, or four, right click on the she...

Delimiter for adding Appointment in Entourage
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC Email Client: Exchange What's the delimiter that Entourage uses if I want to add an appointment and the subject needs to be parsed by the Exchange server? <br><br>In Outlook, the hash/pound key (#) is used as delimiter. How about in Entourage 2008? <br><br>Basically, if I add an entry in a group calendar Out-Of-Office with the subject: #User1# On-Leave <br><br>in Outlook, this entry appears in the group calendar Out-Of-Office and also in User1's personal calendar. <...

Adding Terms & Conditions to the Quote Form
We have a client that would like to add their Terms & Conditions (T&C) text to the bottom of their GP Quotes. I've read that static text boxes in Report Designer can only be 80 characters, so that won't work as the T&C text is approximately 4-5 pages long. Does anyone have any suggestions on how to add this significant amount of text to a GP form? Thank you in advance. Scott No can do Scott - Report Writer is just not capable of this. The best solution is to purchase Accountable Software's Forms Printer - www.accountable.com. Frank Hamelly MCP-GP, MCT, MVP East...

Downloaded payees automatically added to payee list
Please tell me that in Money 2006, Microsoft has finally fixed the bug where the payees in my downloaded transactions are automatically added to my payee list (this despite the fact that I've checked off the option "Confirm new payees"). This alone would be worth the upgrade. On the subject of 2006, does anyone know if Microsoft added the cookie jar concept to accounts? The cookie jar allows you to squirrel money away within an account. TIA greg.block@gmail.com wrote: >Please tell me that in Money 2006, Microsoft has finally fixed the bug >where the payees in my downlo...