Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

switch field to non-edit after initial entry in that field

Status
Not open for further replies.

valmatic

IS-IT--Management
Mar 30, 2006
14
US
Hi. Does anyone know of a way to make an entry field non-editable after the initial entry into that field?

I have a standard date entry field on an access form that, through some code, measures on-time status of a project and reports the status accordingly. A few of my users are changing the date to cover their butts, rendering my reporting useless :( Any help in protecting my data would be greatly appreciated.

I should mention I'm a complete noob in both Access and VBA programming - but I'm learning :)

thanks...
Josh
 
Have a look at the Current event and NewRecord property of the Form object and at the Locked/Enabled properties of the TextBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Try the After Update event of your entry field:

Private Sub NameOfEntryField_AfterUpdate()

Me.NameOfEntryField.Locked = True

End Sub
 
ssatech, unfortunately, when navigating to the next record,
whether "NameOfEntryField" is populated or not,
it will be locked.

As PHV said, OnCurrent is the most appropriate.
for examble

Form_Current()
Me.txtDate.Locked = Not IsNull(txtDate)
End Sub


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top