|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi Everyone,
I am new to Access and am running into a few problems with my database. On my form, I have three date fields (DateAgreed, DateRevised, DateClosed). The dates are entered using the pop-up calendar feature. My question is regarding how to lock this data once it is selected and saved. The DateAgreed and DateClosed should lock as soon as the user saves the data. The DateRevised field should lock after this date has passed The other thing is that for the DateClosed, I only want to let the user selected a date within the past 14 days. Any help would be greatly appreciated. Thanks a lot! |
|
#2
|
|||
|
|||
|
To lock the date field use the OnCurrent Event
If not IsNull(Me!DateAgreed) Then Me!DateAgreed.Locked = True To calculate 14 days or later Use the BeforeUpdate Event If Me!DateClosed <= DateAdd("d",-14,Date) Then _ Me!DateClosed=Null . . . . . and any other action you wish To undo the current record, use the .Undo action |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Locking Date Fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|