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 date on form
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 |
#2
|
|||
|
|||
Default date on form
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. -- Good luck Jeff Boyce Access MVP |
#3
|
|||
|
|||
Default date on form
On Mon, 14 Jun 2004 17:02:01 -0700, joe
wrote: 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. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#4
|
|||
|
|||
Default date on form
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" wrote in message news 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 |
#5
|
|||
|
|||
Default date on form
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 -----Original Message----- 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. -- Good luck Jeff Boyce Access MVP . |
#6
|
|||
|
|||
Default date on form
Joe
Re-check the responses -- they've all given you a way to calculate a date that falls (before or after) a date. -- Good luck Jeff Boyce Access MVP |
Thread Tools | |
Display Modes | |
|
|