.AllowEdits for subForm

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

Guest

In a Form Field's event I want to write a command to enable or disable edits
in Form's subForm.
The following didn't work.

Me![subfName].AllowEdits = False
or
Forms![subfName].AllowEdits = False

I would appreciate any help.
 
You need to reference the form object of the subform control:

Me![subfName].form.AllowEdits = False
 
The syntax was accepted by VBA editor but still I can edit the subForm.

Some more help please.



Sandra Daigle said:
You need to reference the form object of the subform control:

Me![subfName].form.AllowEdits = False


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

In a Form Field's event I want to write a command to enable or
disable edits in Form's subForm.
The following didn't work.

Me![subfName].AllowEdits = False
or
Forms![subfName].AllowEdits = False

I would appreciate any help.
 
Where is the code being called? Are you sure that it is getting executed?
Try setting a breakpoint on the line to be sure that it is. Also, be sure
that subfName is the name of the subform control on the mainform. Click once
on the subform then check the Name property which is found under the 'Other'
tab in the property sheet. Whatever you find there should be used in place
of 'subfName' in the code.


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

The syntax was accepted by VBA editor but still I can edit the
subForm.

Some more help please.



Sandra Daigle said:
You need to reference the form object of the subform control:

Me![subfName].form.AllowEdits = False


--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

In a Form Field's event I want to write a command to enable or
disable edits in Form's subForm.
The following didn't work.

Me![subfName].AllowEdits = False
or
Forms![subfName].AllowEdits = False

I would appreciate any help.
 
Back
Top