I have the following setup:
Table containing record for transactions with products – in and out of a warehouse.
Continuous form for entering transaction information.
I have filtered the form to show only records from today and yesterday.
I locked old records in the current event of the form
Everything works fine until the current record loses focus (I made a check if the user clicks on locked record a message show “You Can’t Edit saved records” ). When the current record loses focus it is locked and the user can’t finish filling in all needed information.
I tried, after the message pops up to move the focus to the new record and it works, but the focus is moved to the current column new record and I have a series of checks that prevent the user to fill in a filed in the new record before filling in information in the previous field. This leads to two messages every time the user clicks on saved record – one “You Can’t Edit saved records” and one “You have to fill in the previous field”.
How can I stop the current record from locking after the “You Can’t Edit saved records” message pops up or set the focus to the first field in the new record?
Table containing record for transactions with products – in and out of a warehouse.
Continuous form for entering transaction information.
I have filtered the form to show only records from today and yesterday.
I locked old records in the current event of the form
Code:
Private Sub Form_Current()
Me.AllowEdits = Me.NewRecord
End Sub
I tried, after the message pops up to move the focus to the new record and it works, but the focus is moved to the current column new record and I have a series of checks that prevent the user to fill in a filed in the new record before filling in information in the previous field. This leads to two messages every time the user clicks on saved record – one “You Can’t Edit saved records” and one “You have to fill in the previous field”.
How can I stop the current record from locking after the “You Can’t Edit saved records” message pops up or set the focus to the first field in the new record?
Comment