Change Subform allowadditions from mainform

aron.ridgway

Registered User.
Local time
Today, 21:41
Joined
Apr 1, 2014
Messages
148
Hello,

i am trying to change the allowadditions property of a subform from the main form? but having little luck
the main form is called frmPurchaseEdit and the Subform is sfrmPurchaseEdit
i have tried a few variations but nothing seems to work?
any ideas?

thanks
 
try

Code:
me.sfrmPurchaseEdit.form.allowedits=true
This assumes that sfrmPurchaseEdit is the name of the subform control, not the name of the sourceobject
 
I have tried the above but get a Compile error: Method or data Member not found?

i think it is the name of the source object is that where i am going wrong??

what should i be referring to?
 
Is there not a way to refer to the subform, to allow additions basically I want to click a command button on the main form, to switch the property of the subform to allow additions?

thanks
 
that is what post #2 does - you just need to use the name of the subform control so if your control is called SF1 and it has a source object of sfrmPurchaseEdit then the code is

Code:
me.SF1.form.allowedits=true
 
Just noticed I referred to the allowedits property, not the allowadditions so the code is

Code:
me.sfrmPurchaseEdit.form.allowadditions=true
 
I have tried
Code:
me.sfrmPurchaseEdit.form.allowadditions = True

but im still getting a Method of data member not found and it highlights the sfrmPurchaseEdit.

This is the name of the subform so im a little lost?
 
Are you sure that frmPurchaseEdit is the active form at the time of the execution of the code?

You might consider trying Forms!frmPurchaseEdit instead of me.
 
Hi George I have tried that, I cant seem to refer to my subform as it dosnt like the name? even though sfrmPurchaseEdit is what its called??

I did copy this subform from another and renamed it could that of caused an error??
 

Users who are viewing this thread

Back
Top Bottom