Problem Adding Records to Subforms

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

Guest

I posted this earlier. Does anyone else have any suggestions about this?

Earlier Post:

No that didn't work. I think I found where the problem is, but still do not
know how to fix it. I wanted users to decide whether they wanted to add a
new record or edit an existing record. Instead of the navigation toolbar, I
inserted a "Add Record" command button. In the main form properties, I set
the AllowAddition Property to 'No' and in the 'On Click' code for the command
button, I inserted the following code:
Me.AllowAdditions = True

This works great with the main form, but does not allow new records to be
added to the subforms. When I removed the command button and put the
navigation toolbar back in and set the main form 'AllowAddition' Property
back to Yes, the subform still would not allow new entries.

I guess my question is now. Is it possible to use a not allow additions
unless an add record is clicked and still be able to add data to the
subforms? If so, what code am I leaving out? Also, will I have the same
problem when I create an edit button and change allowedit property to false?

Thank you for your help.
 
Hi AccessNovice,

Sounds to me like you have your subforms set to not allow additions
either... update your code so that as well as setting your main form to
allow additions, you also set each subform to allow additions eg:

me.subfrmName.form.allowadditions = true

Hope this helps.

Damian.
 
What's weird is I don't have my subforms set to not allow additions. That's
one of the things I really couldn't understand (still don't really). But it
doesn't matter really, because your code worked. I was trying to enter a
similiar code, but was omitting 'Form'. Thanks so much for your help. I
really appreciate it.
 
Back
Top