Solved

DateAdd returns 12/30/1899

Posted on 2008-10-23
7
248 Views
Last Modified: 2013-11-29
I have a date field that needs to be updated.  I created a query with criteria that my field [StartDate] is = or < date() -365.  This returns only the records that are 1 year or older. I then used the query to make thae form.  What I'm trying to do is increase that [StartDate] by 1 year on the form.  I am using a macro set the value, and the value I'm using is:  DateAdd("yyyy",1,[StartDate]), but I get the 1230/1899 date.  What am I doing wrong?
0
Comment
Question by:cebaker75
  • 4
  • 2
7 Comments
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 250 total points
ID: 22786821
What was the original value in StartDate?
0
 

Author Comment

by:cebaker75
ID: 22787583
"10/22/2007" is the date I am testing.  I've changed my query criteria to DateAdd, thinking it was a format issue, but I get the same result.  I should be getting "10/22/2008", at least that's what I want to get.
0
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 250 total points
ID: 22787605
Ok.  What data type are you using for StartDate?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 22787755
can you post the content of your macro
0
 

Author Comment

by:cebaker75
ID: 22787774
Date/Time
0
 

Author Comment

by:cebaker75
ID: 22788052
Well, nevermind.  I copied my setvalue formlua from the macro that wasn't working into a new macro (copy and paste) and it now works???  I have no idea why it didn't work in the first macro, it was the only item in the macro.
0
 

Author Comment

by:cebaker75
ID: 22788060
Thanks to all!
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now