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

Keeping Locked Fields Locked - Access 2000 2

Status
Not open for further replies.

JonWolgamuth

Technical User
Apr 19, 2001
53
US
I have a form that I wanted to improve for the users by allowing them to double click in a cell and autopopulate today's date (using the on double-click > textfieddate=date() approach).

However, I also don't want this field updated until the user hits an edit button which unlocks the editable fields.

Problem is that a double-click still changes the date even when the text field is "locked".

Is there an "if then" statement I can add to the double click event that will prevent a change if the field is locked? I don't know the code well enough to make it up as I go along.

Many thanks in advance!

Jon
 
And what happens if the field is NOT enabled ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, if the field is NOT enabled, then it is grayed out and does not allow the same sort of searchability that a locked field allows.

I'd like to try to figure out how to disallow the double-click from updating the field if it is locked, but certainly let me know if I'm heading in the wrong direction and need to take a different approach altogether.

Thanks for the reply!

Jon
 
So, in the DblClick event procedure of textfieddate:
If Not Me!textfieddate.Locked Then Me!textfieddate = Date()

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, methinks I was making it too difficult! Thanks for the excellent response!
 
How are ya JonWolgamuth . . . . .

In the [blue]DoubleClick[/blue] event have you tried:
Code:
[blue]   If Not Me![purple][b]TextFieldDate[/b][/purple].Locked Then Me![purple][b]TextFieldDate[/b][/purple] = Date[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top