allowadditions in subform

G

geebee

hi,

i would like for the subform to be dynamically changed to where records can
be added when the main form is loaded... i now have:

Forms!frm_charity.Control!sbfrm_template.AllowAdditions = True


but i am getting an application-defined or object-defined error message.

not sure what to do.

thanks in advance,
geebee
 
D

Douglas J. Steele

It needs to be one of

Forms!frm_charity!sbfrm_template.Form.AllowAdditions = True

or

Forms!frm_charity.Controls("sbfrm_template").Form.AllowAdditions = True

Be careful, though, that you're referring to the subform control. Depending
on how you added the form as a subform, the name of the subform control may
not be the same as the name of the form being used as a subform.
 
D

Dirk Goldgar

geebee said:
hi,

i would like for the subform to be dynamically changed to where records
can
be added when the main form is loaded... i now have:

Forms!frm_charity.Control!sbfrm_template.AllowAdditions = True


but i am getting an application-defined or object-defined error message.

not sure what to do.


Your syntax is wrong in two ways. First, it should be "Controls", not
"Control"; second, you need a ".Form" qualifier after "sbfrm_template".
You can leave out the ".Controls" qualifier entirely, though. Try this:

Forms!frm_charity!sbfrm_template.Form.AllowAdditions = True
 
M

Marshall Barton

geebee said:
i would like for the subform to be dynamically changed to where records can
be added when the main form is loaded... i now have:

Forms!frm_charity.Control!sbfrm_template.AllowAdditions = True

but i am getting an application-defined or object-defined error message.


If sbfrm_template is the name of the subform **control** on
the main form, I think that should be:

Me!sbfrm_template.Form.AllowAdditions = True
 
D

dymondjack

Have you tried specifying the subform .Form in your code?

Instead of
...sbfrm_template.AllowAdditions = True

try

....sbfrm_template.Form.AllowAdditions = True

--
Jack Leach
www.tristatemachine.com

- "A designer knows he has reached perfection not when there is nothing left
to add, but when there is nothing left to take away." - Antoine De Saint
Exupery
 

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