.AllowEdits for subForm

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.
 
S

Sandra Daigle

You need to reference the form object of the subform control:

Me![subfName].form.AllowEdits = False
 
G

Guest

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.
 
S

Sandra Daigle

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.
 

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

Top