Edit a row on continuous form while the other rows are locked. (1 Viewer)

BenMason

Member
Local time
Today, 01:28
Joined
May 14, 2021
Messages
33
I have a continuous form with an edit button. On the continuous form, there’s an edit button for every row. I want to be able to highlight the row of the continuous form, store the row ID in a string, and then click the edit button to edit just that row only with the other rows locked. Is this even possible? This is basically for the user’s benefit, so they don’t make mistakes on the continuous form that is open to edit anything and no row locks.

I even tried with a datasheet to lock other rows and only edit the row I am on when the edit button is clicked. I like the datasheet because it has filter lookups. On the datasheet, there is just one edit button in the header. So, it's a main form with a datasheet sub form.

Is there a workaround for the continuous form? Or is it just better to use the datasheet or split form? Not sure how to lock all rows except the one I want to edit.

Thank you.

Ben
 
I would make the datasheet locked and set up the edit button to open the current record in a single form for editing.
 
See demo. The controls at the top should be hidden but left visible for demo.
You can also get rid of the unlock button in the row and just have a single one in the header. Will only let you edit the last selected row.
 

Attachments

Is there a workaround for the continuous form?
No workaround should be needed. If you lock the form, no controls can be edited. If you unlock the form, only the current record can be edited. To lock the rest of the records, simply relock the form using the form's Current event.
 
Last edited:
See demo. The controls at the top should be hidden but left visible for demo.
You can also get rid of the unlock button in the row and just have a single one in the header. Will only let you edit the last selected row.
MajP, it worked! I have several continuous forms and will use this method. Thank you.
 
@theDBguy gave you the simplest answer. In a continuous or DS view form only a SINGLE record can have the focus and so therefore only a single record at a time can be updated. As soon as you move to a new record, you can reestablish the lock using a single line of code. Some people reestablish it in the AfterUpdate event. But that doesn't run if the record does not get saved and if you cancel the update, you leave the current record unlocked and therefore all other records SO, use the Current event to set the lock property for safety.
 
Which is exactly what was demonstrated.
 

Users who are viewing this thread

Back
Top Bottom