Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing "Allow Edits" on a form containing a subform

Status
Not open for further replies.

NCYankee1

Programmer
Mar 27, 2001
66
US
Hi
I thought I posted this already but I dont see it. So I will try again.

Using Access 97, I have a form based on a query. The form has Allow Edits, Allow Additions and Allow Deletions all set to No. When a button is pushed I have this code behind that button to allow updating:
With Me
.AllowAdditions = True
.AllowEdits = True
.AllowDeletions = True
End With
That works fine. Howeverrrrrrrr, there is a subform on the form that is set up all along to allow updates, additions and deletions. But it does not allow updates on this form, even after my allow updates button is poked. What in the wide world of sports is going on? How do I allow updates in the subform?

Thanks!
 
I believe that the parent's properties supercede the child's. So, when you created and set the parent form's properties to FALSE, the child inherited them. When you code the parent to all the changes, the child still has the inherited properties. The key words here are 'created' and 'code'. I'm not swearing this is the answer but it could be.

Try adding the 3 lines of code to your 'WITH' command:

.Form![subFormName].allowadditions = true
.Form![subFormName].allowedits = true
.Form![subFormName].allowdeletions = true

It should force the subform to act like the parent. Hope this helps.

Larry DeMaio
SDC
 
If Larry's suggestion worked, then disregard what I'm going to offer here, but also try to give feedback regarding which solution worked and which didn't.

But it seems to me that the 3 lines you should be adding are:

![subFormName].Form.AllowAdditions=true
![subFormName].Form.AllowEdits=true
![subFormName].Form.AllowDeletions=true

The basic difference is that the "Form" term in the syntax comes after, not before, the subformname. Or so I think. . . -- Herb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top