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!

Lock/disable One record at a time

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have a Form set to continuous. I have a field on the form named Roll. This field is populated by a dropdown selection box. I also have a field on the form named Done...this is a yes/no field type.

So my form can show many records (continuous form). When the Done field is checked I want to lock the Roll field so it cannot be changed....but the next record on the form should be available to change until it's done box is checked.

I added code to lock the Roll field when the Done box is checked. It worked...I could not change the field.....However...when I changed values in the Dropdown for that record it Did update the Roll field even though it was locked. I do not want this to happen. I want each Roll field in each record to be controlled by its Done selection as to weather it is locked or not.

How can I do this? And, still leave the rest of the records, without the Done box being checked, available for input.
 
How are ya puforee . . .

In the forms [blue]on Current[/blue] event, try this:
Code:
[blue]   Me![CheckboxName].Locked = Me!Done[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
TheAceMan1...yep, after posting this I figured out I had to set the lock when on the record and when changing records, the On Current event would check to see if the Done was checked or not and take the appropriate action.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top