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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

If Statements 4
fomr opens to wrong record 8
can't find form 4
Opening form to specific record 3
stLinkCriteria 3
cannot filter continuous form data 2
Inserting data in forms 2
Copying from two forms 10

Top