Is form read-only?

C

CyberDwarf

Mebbe I need a new brain....

I need to check if a form is open in read-only mode.

I open it with:-


If InVal = 150 Then
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
What do I need to do to check the open mode from within the opened form?

TIA

Steve
 
M

Marshall Barton

CyberDwarf said:
Mebbe I need a new brain....

I need to check if a form is open in read-only mode.

I open it with:-


If InVal = 150 Then
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
What do I need to do to check the open mode from within the opened form?


The read only data mode sets the form's AllowEdits,
AllowAdditions and AllowDeletions properties to False.
 
F

fredg

Mebbe I need a new brain....

I need to check if a form is open in read-only mode.

I open it with:-

If InVal = 150 Then
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
What do I need to do to check the open mode from within the opened form?

TIA

Steve

In the form's Load event:

If Me.AllowAdditions = False And Me.AllowDeletions = False _
And Me.AllowEdits = False Then
MsgBox "Form is ReadOnly"
Else
MsgBox "Form is not read only"
End If
 
Top