Date + 10 days?

  • Thread starter Thread starter Bob Quintal
  • Start date Start date
B

Bob Quintal

=?Utf-8?B?YXJjaDI1Mg==?= <[email protected]>
wrote in
I have a field that shows the date I sent a notice to someone.
I want to create a field that automatically shows the date
the notice is due back, which is 10 days from the sent date.
I would also like the field to show up in red when the due
date is past.

Set the control source of the new field to
=dateAdd("d",10,[DateSent])

Set the conditional format of the control to 'less than' DATE()
 
I have a field that shows the date I sent a notice to someone. I want to
create a field that automatically shows the date the notice is due back,
which is 10 days from the sent date. I would also like the field to show up
in red when the due date is past.
 
In your query, add the following calculated field:
DueDate: DateAdd("d",[NameOfDateSentField],10)
replacing NameOfDateSentField with the actual name of your sent date field.
Note that you should not store the DueDate field in a table, since it can be
calculated as required.

In your form or report (based on the query containing the DueDate field),
apply conditional formatting to the control bound to the DueDate field. Set
the condition to Field Value Is less than Date(), and select the text
colour/background colour you want.

HTH,

Rob
 
Bear with me, this is waaaaaay over my head, but I created the query and
added the calculated field information that you gave me and it is working
correctly because it the field appears in the Query Datasheet View. How can
I add that so it appears as a column on my table?

Rob Parker said:
In your query, add the following calculated field:
DueDate: DateAdd("d",[NameOfDateSentField],10)
replacing NameOfDateSentField with the actual name of your sent date field.
Note that you should not store the DueDate field in a table, since it can be
calculated as required.

In your form or report (based on the query containing the DueDate field),
apply conditional formatting to the control bound to the DueDate field. Set
the condition to Field Value Is less than Date(), and select the text
colour/background colour you want.

HTH,

Rob

arch252 said:
I have a field that shows the date I sent a notice to someone. I want to
create a field that automatically shows the date the notice is due back,
which is 10 days from the sent date. I would also like the field to show
up
in red when the due date is past.
 
As I said in my original post, you should NOT store the DueDate as a field
in your table. Since it can be calculated on-the-fly, that is what you
should do.

You simply base your form (or report) which is presenting the data on the
query with the DueDate field, rather than on the table. You are using a
form for your date entry/display, aren't you? Tables are for data storage,
not for data entry/editing. And the conditional formatting, which is what
you need for displaying some records with high-lighted fields, will only
work in forms and reports; you cannot use it in table or query datasheets.
You can set up a form in continuous view so that it resembles a table/query
datasheet if that's waht you want; or (better, and commonly) you design the
form so that it provides a clear useable interface to your data.

If this is all clear-as-mud to you, then I suggest you do some background
reading before going any further. Either buy a suitable reference book, or
browse some of the many web sites which offer Access tutorials. As a start,
here's a link to a compilation of Access resources and other information:
http://www.accessmvp.com/JConrad/accessjunkie.html

Again, HTH,

Rob

arch252 said:
Bear with me, this is waaaaaay over my head, but I created the query and
added the calculated field information that you gave me and it is working
correctly because it the field appears in the Query Datasheet View. How
can
I add that so it appears as a column on my table?

Rob Parker said:
In your query, add the following calculated field:
DueDate: DateAdd("d",[NameOfDateSentField],10)
replacing NameOfDateSentField with the actual name of your sent date
field.
Note that you should not store the DueDate field in a table, since it can
be
calculated as required.

In your form or report (based on the query containing the DueDate field),
apply conditional formatting to the control bound to the DueDate field.
Set
the condition to Field Value Is less than Date(), and select the text
colour/background colour you want.

HTH,

Rob

arch252 said:
I have a field that shows the date I sent a notice to someone. I want
to
create a field that automatically shows the date the notice is due
back,
which is 10 days from the sent date. I would also like the field to
show
up
in red when the due date is past.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top