open form read only

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

Guest

I'm using the code (this is a simplification of the entire code),
sub routineName()
Dim mode as integer
Dim identifier as long
mode = 2
identifier = Me.ID.Value
DoCmd.OpenForm FormName:="frm_Entry", view:=acNormal, wherecondition:="ID="
& identifier, datamode:=mode
'some code
End sub

But when the form opens, it isn't read only. I can edit the record the form
has been filtered to. Oddly, depending on which procedure calls this
subroutine, sometiem the first field or two will not be editable, but after
tabbing through, the other fields are. Could the form be resetting to allow
edits once it's already open? Any clues as to causes/solutions?
 
Have you try putting acFormReadOnly in the data mode

docmd.OpenForm "formName",,,,acFormReadOnly
 
Back
Top