Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Access
Back to Access Forum    Comments List
Lock a Field with Data in it Upload Images   Link   Email  
Michael Jones 
I want to be able to lock a field after data has been entered so no one can change it. I still need to enter Data in that field for new records, Is there a way to do this.
Richard Rost 
I would suggest an OnGotFocus event and the Locked property. You can say something like:

If IsNull(FieldName) Then
   FieldName.Locked = TRUE
Else
   FieldName.Locked = FALSE
End If

When the field gets focus, it will be either locked or unlocked based on whether or not is has data. You'll have to come up with a way around this for Admins who need to be able to edit the value, or just go right to the table.

You can also do a similar trick with entire records in the OnCurrent event.

I've covered these concepts in my classes, but this would make a neat TechHelp video. I'll add it to the list.
Michael Jones 
Thank you I will try it and hope it works, I will keep a look out for your TechHelp video

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 8:36:30 AM. PLT: 0s