Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 1st, 2004, 09:12 AM
shwin shwin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 10 shwin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face Locking Date Fields

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!

Reply With Quote
  #2  
Old July 3rd, 2004, 08:04 PM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Locking Date Fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT