Read Only access to forms that fire code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to set up some of my users to have read only access to a particular database. The forms and controls are all bound to the underlying data. A lot of my code sets settings based upon other field settings, basically automating the data entry process. My problem is that when one reviews existing data this code still runs, it is somewhat unnecessary as the saved values are already present in the recordset. When I login as my "View only" user and navigate through existing records I get run time errors stating the recordset is read only. Is there a way to know if a record being shown is an already saved record as opposed to a new record
 
If you only want code to run when a record is being updated, then your code
needs to be in the before update event.

If you only want code to run when a NEW record is created,then that code
needs to be in the on-insert event.

You can also check if the record is new in code by:

if me.NewReocrd = True then
bla bla.
end if

So, if your code is running, it kind of sounds like you have code all over
the place in the WRONG events. The same issue applies to each text box on
the screen. If you use the before update event of a field, the code DOES
NOT run if the field is not modified.

So, by using the correct events...you code should not be running.
 
Back
Top