Adding and Linking Dates to Another Field

I have two (2) field in my form.  Field 1 is called "Date" and field 2 is 
called "Due Date".  I would like the "Due Date" field to automatically add 90 
days from the "Date" field and have that updated in the "Due Date" field.  I 
tried using the DateAdd function in the control box and also the default 
portion of the field.

Any help would be appreciated. 

Thank you,

TomP
0
Utf
12/6/2007 5:44:01 PM
access.formscoding 7494 articles. 0 followers. Follow

4 Replies
394 Views

Similar Articles

[PageSpeed] 20

For staters, change the name of the field you call Date.  Date is an Access 
reserved word.  Even when enclosing the name in brackets [Date], you can have 
problems.
Where you do it depends on when you do it.  My suggestion would be to use 
the After Update event of the control on your form to which the Date field is 
bound.

     Me.txtDueDate = DateAdd("d", 90, Me.txtDate)
-- 
Dave Hargis, Microsoft Access MVP


"TomP" wrote:

> I have two (2) field in my form.  Field 1 is called "Date" and field 2 is 
> called "Due Date".  I would like the "Due Date" field to automatically add 90 
> days from the "Date" field and have that updated in the "Due Date" field.  I 
> tried using the DateAdd function in the control box and also the default 
> portion of the field.
> 
> Any help would be appreciated. 
> 
> Thank you,
> 
> TomP
0
Utf
12/6/2007 5:56:01 PM
Thank you for the quick response!

I opened the "duedate" field and added the statement as typed and nothing 
happened...:-(

  I entered a date in the "date" field and moved to the next and nothing is 
shown in the "duedate" field.  Ideally, it would be nice if the "duedate" 
would automatically reflect the 90 day deadline.  The due date would not be 
visible to the form and be used in the reports.

Tom

"Klatuu" wrote:

> For staters, change the name of the field you call Date.  Date is an Access 
> reserved word.  Even when enclosing the name in brackets [Date], you can have 
> problems.
> Where you do it depends on when you do it.  My suggestion would be to use 
> the After Update event of the control on your form to which the Date field is 
> bound.
> 
>      Me.txtDueDate = DateAdd("d", 90, Me.txtDate)
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "TomP" wrote:
> 
> > I have two (2) field in my form.  Field 1 is called "Date" and field 2 is 
> > called "Due Date".  I would like the "Due Date" field to automatically add 90 
> > days from the "Date" field and have that updated in the "Due Date" field.  I 
> > tried using the DateAdd function in the control box and also the default 
> > portion of the field.
> > 
> > Any help would be appreciated. 
> > 
> > Thank you,
> > 
> > TomP
0
Utf
12/7/2007 12:40:01 AM
It sounds like you did not put the code in the proper place.  If you entered 
a value in the date field and the code is in the After Update event of the 
date field, then the value should show up in the due date field.
-- 
Dave Hargis, Microsoft Access MVP


"TomP" wrote:

> Thank you for the quick response!
> 
> I opened the "duedate" field and added the statement as typed and nothing 
> happened...:-(
> 
>   I entered a date in the "date" field and moved to the next and nothing is 
> shown in the "duedate" field.  Ideally, it would be nice if the "duedate" 
> would automatically reflect the 90 day deadline.  The due date would not be 
> visible to the form and be used in the reports.
> 
> Tom
> 
> "Klatuu" wrote:
> 
> > For staters, change the name of the field you call Date.  Date is an Access 
> > reserved word.  Even when enclosing the name in brackets [Date], you can have 
> > problems.
> > Where you do it depends on when you do it.  My suggestion would be to use 
> > the After Update event of the control on your form to which the Date field is 
> > bound.
> > 
> >      Me.txtDueDate = DateAdd("d", 90, Me.txtDate)
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "TomP" wrote:
> > 
> > > I have two (2) field in my form.  Field 1 is called "Date" and field 2 is 
> > > called "Due Date".  I would like the "Due Date" field to automatically add 90 
> > > days from the "Date" field and have that updated in the "Due Date" field.  I 
> > > tried using the DateAdd function in the control box and also the default 
> > > portion of the field.
> > > 
> > > Any help would be appreciated. 
> > > 
> > > Thank you,
> > > 
> > > TomP
0
Utf
12/7/2007 2:34:02 PM
It works now.  Thank you for your help!  

Merry Christmas!

"Klatuu" wrote:

> It sounds like you did not put the code in the proper place.  If you entered 
> a value in the date field and the code is in the After Update event of the 
> date field, then the value should show up in the due date field.
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "TomP" wrote:
> 
> > Thank you for the quick response!
> > 
> > I opened the "duedate" field and added the statement as typed and nothing 
> > happened...:-(
> > 
> >   I entered a date in the "date" field and moved to the next and nothing is 
> > shown in the "duedate" field.  Ideally, it would be nice if the "duedate" 
> > would automatically reflect the 90 day deadline.  The due date would not be 
> > visible to the form and be used in the reports.
> > 
> > Tom
> > 
> > "Klatuu" wrote:
> > 
> > > For staters, change the name of the field you call Date.  Date is an Access 
> > > reserved word.  Even when enclosing the name in brackets [Date], you can have 
> > > problems.
> > > Where you do it depends on when you do it.  My suggestion would be to use 
> > > the After Update event of the control on your form to which the Date field is 
> > > bound.
> > > 
> > >      Me.txtDueDate = DateAdd("d", 90, Me.txtDate)
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "TomP" wrote:
> > > 
> > > > I have two (2) field in my form.  Field 1 is called "Date" and field 2 is 
> > > > called "Due Date".  I would like the "Due Date" field to automatically add 90 
> > > > days from the "Date" field and have that updated in the "Due Date" field.  I 
> > > > tried using the DateAdd function in the control box and also the default 
> > > > portion of the field.
> > > > 
> > > > Any help would be appreciated. 
> > > > 
> > > > Thank you,
> > > > 
> > > > TomP
0
Utf
12/8/2007 12:00:00 PM
Reply:

Similar Artilces:

handling links to external spreadsheets
I have a large number of links to cells in an external spreadsheet that look like the following, where different cells on the source spreadsheet are referenced: for example, contents of cell Z5 on the destination spreadsheet: ='http://dummy_address.com/teams/projects/[data_analysis.xls]sheet1'! C3 (source location) I would like to have the ability to easily change the path, filename and sheetname for this large number of references while leaving the target cell (C3 in the case above) the same. Is there some method where I could put the path, filename and sheetname in cells on the des...

excel links in word docs
sometimes when I have an excel worksheet linked in a word doc the fonts look and print different. I ahve checked and the font is set to the same ariel 11 in both, but the text in the excel part of the doc lools and print like it is streched out. any ideas? Hi jnine, That can happen if the Height/Width scaling of the embedded Excel object has been changed from the default scaling. -- Cheers macropod [Microsoft MVP - Word] "jnine" <jnine@discussions.microsoft.com> wrote in message news:1E90C143-EB7D-4B27-B203-7BB7A173073B@microsoft.com... > sometimes ...

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...

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 ...

External Link Issue
I have come across something rather bizarre that I hope someone can answer. I opened a workbook in excel, we will call it Book1, that has external links, I opt to "Don't Update". In the workbook are links to someone's C: drive and as far as I am aware I don't have access to their drive. Also FYI ... The status bar in the lower right says "Ready" ... not "Calculate". Plus, if I hit "F9" the numbers remain the same. When I look at a cell "D10" it shows $90. Then I open a copy of the same file but named Book2 .... Book1 is still ope...

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...

Linking to a Password Protected Document in Excel 2000
I have a document that is password protected. I also have a file that references the protected files for many of the its formulas. Each time I open the file and update the links I am prompted multiple times (once for each cell reference to the protected file) for the password. Is there any setting so that a user is only prompted once for the password to a reference file that is protected? I know that one option is just to copy the tabs from my referencing file into the protected file, but it would be nice to keep the documents separate. Thanks, Andrew One option might be to disable th...

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 ...

Another Outlook Question
Whenever I compose a message the window always is small and I have to maximize this. Is there a way to have thw window always be large? Thanks and may God bless you John -- Do not store up for yourselves treasures on earth, where moth and rust destroy, and where thieves break in and steal. But store up for yourselves treasures in heaven, where moth and rust do not destroy, and where thieves do not break in and steal (Matt 6:19-20). "Jeremiah" <jeremiah@truth.org> wrote in message news:OU8Jd2dJGHA.2012@TK2MSFTNGP14.phx.gbl... > Whenever I compose a message the win...

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...

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 ...

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...

Criteria Parameter in query for two fields: help
I have a form that utilizes two contact lists in separate combo boxes to illustrate projects that multiple people have worked on. I am trying to make it so that a report will illustrate the associated data based on these contacts. The selection will be based on either one contact (from either list) or both. Whereby on selection, the report will generate the associated data based on these user names. How would I go about creating a parameter in the query so that it will limit the content to reflect either contact list or a combination of the two? I am a beginner to Acc...

bcc and attachment fields
Is there a way to make the bcc and attachments fields always show up at the top of a new email under the To: , CC:, and Subject fields??? Thanks are you meaning that attachments will not show in the body? I am looking for that answer too. -- Dave M Radeon 9800Pro 256mb P4 2.8 oc to 3.1 "sendhost3000" <sendhost3000@yahoo.com> wrote in message news:eYXGYYYxDHA.3224@tk2msftngp13.phx.gbl... > Is there a way to make the bcc and attachments fields always show up at the > top of a new email under the To: , CC:, and Subject fields??? > > Thanks > > -----= ...

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...

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...

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...

linking multiple worksheets
I know this is possible because we have a document at work that does this -- just can't figure out how: I have multilple worksheets in a workbook and I want to merge the data on to one worksheet so that the numbers add up and so that the summary page is linked to each worksheet -- changes are made in individual worksheets. I can see the cell formula, but know there is a quicker way to do this than typing in formulas for each cell. All of the worksheets are identical. Thanks. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and ...

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. <...

CRichEditCtrl with links
Hiya, I'm using VC++ 6.0 and trying to get a CRichEditCtrl (Rich Edit 2.0) to handle links, which is a bit tricky... I've figured out how to set CFE_LINK and get EN_LINK notifications. So far all is good and well. However 1) When I save the contents (StreamOut) the attribute isn't saved, thus if I StreamIn it back, the link's gone. Is there a way to make the link persistent? 2) I am using arbitrary links (ie not EM_AUTOURLDETECT) and would like to find a way to associate the link with a destination. Any ideas how to accomplish that? I've tried making hidden text, but i...

Write XML with all columns/fields
Hi all, I am doing a windows mobile project that uses ASP.NET web services. Web service returns dataset-s that are pulled from database and later saved on local mobile storage (write XML). On client (WM 6.1) program loads dataset (read XML and read XML schema) when needed. User can insert/aappend new records. My problem occures when some data fileds are empty... default method WriteXML, on client side, does not create XML nodes for empty fields/columns. Than when you are trying to reference some field value that was empty, you get exception. Is there any property or method o...

Linked Tables Twice?
Hi all Currently we have an access 2000 backend database with front ends on access 2003 and 2007. I am looking at creating a database which references some of the tables in the original backend. Rather than risk disturbing this database I was considering creating another backend database with the original tables linked to the new backend. Then the front ends would link to the new back end and by association, the linked tables in the old back end. Will this work or is it just plain nuts/bad practice? TIA Phil TheScullster wrote: >Hi all > >Currently we ha...

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...