Default date on form

J

joe

Hello ,

It it possible to have a default date set on the form for every saturday of the month.I always have to go to properties of the date field and change it to saturdays even though the entries are done on every monday,(report requirements need to reflect a saturday date).
Thanks
 
J

Jeff Boyce

Joe

Are you saying that you want to use a form to set a date that reflects the
next Saturday following the day entries are done? I don't understand what
you mean by "for every saturday of the month."

If your entries a ALWAYS made on a Monday, you could use Date() + 5 to get
the Saturday date.
 
J

John Vinson

Hello ,

It it possible to have a default date set on the form for every saturday of the month.I always have to go to properties of the date field and change it to saturdays even though the entries are done on every monday,(report requirements need to reflect a saturday date).
Thanks

Well, no: a default *is a value*, not "every Saturday".

Which Saturday do you want - previous or next? I'd suggest using VBA
code in the AfterUpdate event of the date field:

Private Sub txtDatefield_AfterUpdate()
Me!txtDateField = DateAdd("d", 1 - _
DatePart("w", txtDateField, vbSaturday))
End Sub

Make it 8 instead of 1 if you want the Saturday following the date.
 
G

GVaught

If the entries are done every Monday you can calculate the date for Saturday
by using the DateAdd Function.
On the report that prints out create an textbox and place the calculation:
=DateAdd(d, 5, [DateField]). Where 'd' indicates day, 5 indicates the number
of days to add to the Date in the DateField and [DateField] is the name of
your field where the your date indicates Monday's date.

This will only work if all entered dates truly fall on a Monday. This also
eliminates the need to change the date entered at data entry time as the
calculated field on the report will calculate to a Saturday date. You can
hide the original date and show the calculated date.
joe said:
Hello ,

It it possible to have a default date set on the form for every saturday
of the month.I always have to go to properties of the date field and change
it to saturdays even though the entries are done on every monday,(report
requirements need to reflect a saturday date).
 
J

Joe

First thanks for all the responses.

Ok, yesterday was Monday the 14, I have to go into
properties of the date field and change it to reflect the
past Saturday....the 12th.Next week it will be the same
thing...Monday the 21th...i will have to change it for the
previous Saturday..the 19th.All entries are done on Monday
but must reflect a saturday date......just looking for an
automated way to have this done for me....thanks for any
direction on this
 
J

Jeff Boyce

Joe

Re-check the responses -- they've all given you a way to calculate a date
that falls (before or after) a date.
 

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

Top