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
|
|||
|
|||
vbSunday
I would like to have each new record start with the first day of the week
(vbSunday) e.g. first record date would be 03-Sep-06 next record date 10-Sep-06 etc. Each time I start a new record I would like the Date to appear in the Date field. This is for scheduling purposes. Each record equals a scheduled event on the coming week. Each new date would have to be vbSunday and continually add seven days fron previous date. |
#2
|
|||
|
|||
vbSunday
Sandrao,
If you won't have any missing weeks, you can make the DefaultValue for the field equal to the max date in the table + 7: Enter into the DefaultValue property: =DMax("[YourDateField]","YourTable")+7 You could also set the textbox' Locked property to Yes to avoid changes. If you wish to permit the user to enter ANY Sunday, you can use the BeforeUpdate event of the form: ' BeforeUpdate code If Weekday(Me![YourDateTextBox]) vbSunday Then MsgBox "Date must be a Sunday." Cancel = True ' Optionally set the textbox to the max date + 7 as above here Me![YourDateTextBox].SetFocus End If Hope that helps. Sprinks "sandrao" wrote: I would like to have each new record start with the first day of the week (vbSunday) e.g. first record date would be 03-Sep-06 next record date 10-Sep-06 etc. Each time I start a new record I would like the Date to appear in the Date field. This is for scheduling purposes. Each record equals a scheduled event on the coming week. Each new date would have to be vbSunday and continually add seven days fron previous date. |
Thread Tools | |
Display Modes | |
|
|