Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2008

Tip: Looking for answers? Try searching our database.

Locking specific fields after Inserts

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jasmine - 06 May 2008 13:50 GMT
Hi ,

   I'm looking for a way to lock specific fields in my form
after inserting a record
I do not want to lock the entire sub-form, but only certain field
example : Only Entrydate, Notes

I do however want to be able to write to these fields Prior to  insert
but lock the field right after.

The Reason is :
       Some users are changing previously entered information thereby
circumventing the system.
    If users need to update a previously entered Information I want
them to create a new record with information of that change-
It's almost like a protective Audit Tracking Mechanism.

Any thoughts would be highly appreciated.
Jeff Boyce - 06 May 2008 14:02 GMT
One approach might be to display the former records via a form that doesn't
allow changes.  Check the properties of the form.

Signature

Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

> Hi ,
>
[quoted text clipped - 14 lines]
>
> Any thoughts would be highly appreciated.
John Spencer - 06 May 2008 15:20 GMT
You could use the current event of the form to lock specific controls.  The
specific code depends on whether or not you want to lock controls that have
data in them or you want to lock/unlock the controls depending on whether the
associated record is a new record.

Private Sub Form_Current()
'Choose one of the options
'Lock the control if this is not a new record
   If Me.New_Record = False Then
      Me.txtLinkTo.Locked = True
   Else
      Me.txtLinkTo.Locked = False
   End If

'==================================================
'OR option two
'lock the control if the control's value is not null
   Me.txtLinkTo.Locked = IsNull(Me.txtLinkTo)
'==================================================

End Sub

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

> Hi ,
>
[quoted text clipped - 14 lines]
>
> Any thoughts would be highly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.