Prevent a row from being locked in certain cases (1 Viewer)

FrostByte

Registered User.
Local time
Today, 16:02
Joined
Jan 15, 2015
Messages
56
Hi,

I have a field called "Status" and if this is set to a certain value (e.g Awaiting Approval", I want to prevent users from locking a row out and making changes.

The reason for this is that managers routinely run update queries which set various values if they approve the input and if users are in said records, these updates of course fail (due to record locking behavior).


Kind Regards
 

Mark_

Longboard on the internet
Local time
Today, 09:02
Joined
Sep 12, 2017
Messages
2,111
Have a flag of some kind (or status, or what ever) that is checked when the user opens the form(s). If set, don't allow them to edit.
 

FrostByte

Registered User.
Local time
Today, 16:02
Joined
Jan 15, 2015
Messages
56
Have a flag of some kind (or status, or what ever) that is checked when the user opens the form(s). If set, don't allow them to edit.


Presuming this would require some VBA code set on "On Current"?
 

Mark_

Longboard on the internet
Local time
Today, 09:02
Joined
Sep 12, 2017
Messages
2,111
That depends on how you want to present this to your users.

You can either check PRIOR to opening the form (make all records 'Locked' blue or something) AND prevent the form from being opened in edit mode OR change the mode when they are moving through the records on your form(s).

It depends on how you are displaying data and how you are allowing users to select records. If you only allow them to view the data in data sheet mode prior to selecting a record for edit, THIS thread can help. If you are allowing a different way to select records, you will have to work out for each approach how you want to notify the user they can't edit data.
 

FrostByte

Registered User.
Local time
Today, 16:02
Joined
Jan 15, 2015
Messages
56
That depends on how you want to present this to your users.

You can either check PRIOR to opening the form (make all records 'Locked' blue or something) AND prevent the form from being opened in edit mode OR change the mode when they are moving through the records on your form(s).

It depends on how you are displaying data and how you are allowing users to select records. If you only allow them to view the data in data sheet mode prior to selecting a record for edit, THIS thread can help. If you are allowing a different way to select records, you will have to work out for each approach how you want to notify the user they can't edit data.

From experimenting with on current and using....

If me.field = "Y" then
Me.AllowEdits = False
end if

This doesn't work and I can fully edit records.
 

Mark_

Longboard on the internet
Local time
Today, 09:02
Joined
Sep 12, 2017
Messages
2,111
How are you calling the form?
Will the form allow you to navigate between records?
Is the form continuous? Datasheet? Other?

Without a very good idea of how you are allowing access to records the only advice I can give is rather general in nature.
 

Users who are viewing this thread

Top Bottom