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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is Dynamic Field Locking possible in datasheet mode?

Status
Not open for further replies.

BJZeak

Programmer
May 3, 2008
230
CA

Given a Subform controlling a table in datasheet mode ... looking to use a value of another field in the same row to determine if a specific field in this row is locked (not editable)

Code:
Ndx SomeField LockState 
0      A         Locked
1      B         Locked
2      C         Locked
3      D         Locked
4      E         
5      F

Could an event that somefield triggers be able to dynamically change the subform's field locked parameter based on the lockstate value?

i.e. me.[SomeField].locked = me.[LockState] = "Locked"

if this could work what would be the best text field event to use ... gotfocus?
 
You can use conditional formatting to set a control or controls to disabled based on an expression like [LockState] = "Locked".

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
enable/Disable changes the color of the field ... where I believe locked doesn't
 
Thanks ... worked out the issue(s) with the original concept ... it is now working as desired using the Somefield's got focus event
 
I thought you might want to use a no-code solution that also provides a visual indication to your users that the control is locked.

The got focus event sounds reliable.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top