Editing subforms; cont'd from prev. post

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

Guest

I am working on the same problem, and apparently I am not understanding the
differnce between the subform name (in my case 'frmSupplierSubform', which I
named myself) and the subform 'control' that needs to be referenced in the
code. When I use 'Me.frmSupplierSubform.frmSuppliers.AllowEdits = True' it
highlights the subform name with the error message 'Method or data member not
found.'
Can you shed a little more light on the issue for me? The name of my main
form is 'frmSuppliers'.
~KK
 
K@foss-dental said:
I am working on the same problem, and apparently I am not understanding the
differnce between the subform name (in my case 'frmSupplierSubform', which I
named myself) and the subform 'control' that needs to be referenced in the
code. When I use 'Me.frmSupplierSubform.frmSuppliers.AllowEdits = True' it
highlights the subform name with the error message 'Method or data member not
found.'
Can you shed a little more light on the issue for me? The name of my main
form is 'frmSuppliers'.

When you want to refer to the properties of the form object
being display in a subform control, you need to use the Form
property of the control:

Me.frmSupplierSubform.frmSuppliers.FORM.AllowEdits = True
 
Marshall Barton said:
When you want to refer to the properties of the form object
being display in a subform control, you need to use the Form
property of the control:

Me.frmSupplierSubform.frmSuppliers.FORM.AllowEdits = True

Marsh,
Thanks for the reply, but unfortunately when I use the syntax you provided I
still get the same error message 'Method or data member not found'.
Any insughts???
~KK
 
K@foss-dental said:
Thanks for the reply, but unfortunately when I use the syntax you provided I
still get the same error message 'Method or data member not found'.


Arrggghhh, I locked in on the one problem and completely
ignored the other. You should not be mentioning the name of
the main form or the name of the form in the subform
control. Just use the name of the subform control, which I
think is frmSupplierSubform. If it is, the code should be:

Me.frmSupplierSubform.Form.AllowEdits = True
 
New message (reply)---
Marshall,
First, thanks for all your help. But I am still getting the same error
message ('Method or data member not found'.) Does it matter that my edit
button is located in the footer section of the subform? Having the edit
button on the main form header does not seem to matter. And to borrow a
phrase from you...
Arrggghhh!
~K
 
Marshall,
Handsprings and hazzah! I did it...but I had to use the syntax you provided
in a macro. It just would not work in VBA. But whatever; success is
success. Thanks again for the help.
~K
 
What a twisty path to a solution, but as long as you get
there ;-)

Actually, the code I posted was supposed to be run from a
button on the main form. If you want the code to run from a
button on the subform and set the property of the subform,
then all you needed is Me.Allowedits = True

It is critical that you understand that Me refers to the
form object that contains the line of code. So, code in the
subform uses Me to refer to the subform while code in the
main form uses Me to refer to the main form.
 
Back
Top