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
|
|||
|
|||
Default Value
In the primary table, I have an "ApproveDate" field, the next field
(ReportDate), I want a default value to be 6 months from ApproveDate. What is the expression for this? -- Dine Lene |
#2
|
|||
|
|||
Default Value
Hi
Your would be best off deleting the Report Date from the table and just create a query based on your table. You can have a calculted field in the query to display your 6 months in advance date SELECT DateAdd("m",6,[TableName]![ApprovedDate]) AS ReportDate, FROM TableName; -- Wayne Manchester, England. "Dine Lene" wrote: In the primary table, I have an "ApproveDate" field, the next field (ReportDate), I want a default value to be 6 months from ApproveDate. What is the expression for this? -- Dine Lene |
#3
|
|||
|
|||
Default Value
Are you attempting to do that because you expect EVERY [ReportDate] to be 6
months after [ApproveDate], or is it possible that you'd have a [ReportDate] that was NOT 6 months later? Regards Jeff Boyce Microsoft Office/Access MVP "Dine Lene" wrote in message ... In the primary table, I have an "ApproveDate" field, the next field (ReportDate), I want a default value to be 6 months from ApproveDate. What is the expression for this? -- Dine Lene |
#4
|
|||
|
|||
Default Value
Some thouths for 6 month's from now:
Whether you save it as a separate field or simply use the 6 month add routine, don't forget that you will most probably need to ALWAYS do a range search on the report date for your report. Today is Thursday. But 6 months from now might NOT be a normal work day or it might end up on a Holiday. What date will you get adding 6 months to Dec 31st? During a leap year? During a non-leap year? Ron |
#5
|
|||
|
|||
Default Value
On Wed, 17 Dec 2008 13:29:01 -0800, Dine Lene
wrote: In the primary table, I have an "ApproveDate" field, the next field (ReportDate), I want a default value to be 6 months from ApproveDate. What is the expression for this? Looks like nobody has actually answered your question. You've probably already figured it out, but I'll answer for posterity. Since you used the word "default", I'm assuming that the ReportDate isn't *always* 6 months later, in which case it would be true that you shouldn't store it at all. But it's perfectly fine to store it if it's just a default value that could change independently of the ApproveDate. In the form that edits the ApproveDate, but a bit of code in the AfterUpdate event of the ApproveDate control: 'default ReportDate to 6 months after ApproveDate Me.ReportDate = DateAdd("m", 6, Me.ApproveDate) As Ron mentioned, this future date could end up falling on a weekend or holiday, so if you're checking if it has arrived, make sure you check for dates = Date(), not just =. Armen Stein Microsoft Access MVP www.JStreetTech.com |
Thread Tools | |
Display Modes | |
|
|