If Me.DataEntry = True Then
The form is Editable
Else
The form is Read Only
End If
To test this out, create a new form, set the DataEntry property to yes, use this condition with a message box.
Dim res as String
If Me.DataEntry = True Then
res = MsgBox("This Form is Editable", vbOKOnly, "fyi"
Else
res = MsgBox("This Form is Read Only", vbOKOnly, "fyi"
End If
Then use your openform command with the read only argument
See Below
DoCmd.OpenForm "form1", acNormal, , , acFormReadOnly
Then see which message you get.
You should get "This Form is Read Only"
That's the message I get.
If AllowEdits Then
MsgBox "Fully Editable"
Elseif DataEntry And NewRecord Then
MsgBox "Editable now: new record"
Else
MsgBox "Not Editable"
End If
If it's a data entry form with AllowEdits = False, you can edit only[b/] the new record. All saved records that may still be on the screen are read only...
Now I have a (stupid) question: why did you use MsgBox() function instead of MsgBox statement?
Even if the Form's default DataEntry is set to Yes (True),
the form will be opened with the above command and the DataEntry property will be set to No (False), presumably because You cannot do Data Entry on a Form that is Read Only
Unless I'm missing something, that should do the trick. I'm Your Huckleberry!
Yes...but re-reading your original post, I can say david was right...you asked if "acFormReadOnly or other such parameters were used when opening a form"
I gave you a solution to check if the form accepts edits at the moment of checking...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.