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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't seem to reference subform on a tab

Status
Not open for further replies.

TrollBro

Technical User
Sep 4, 2004
98
US
hello

I have a form with a subform, and had used the the following code which worked fine:

Me.Form.frm_Participants_subform.Locked = False

I changed the form to use tabs, and placed the subform on one of the tabs. Now that code no longer woks. I've tried everything I could find on TT and still cannot seem to get it right. Can anyone help me out with a suggestion?

Thanks
 
Thanks Remou

But my original code did not refer to a tab - I didn't even have one previously. I'm not referring to one now either - at least I didn't think I was. I have a form "frm_DataEntry". On that form, I have a Page with a number of Tabs. On one of the Tabs, I placed the subform "frm_Participants_subform". I just want to lock the subform itself to prevent edits. Any thoughts?

Thanks
 
Thanks Remou

I had already seen the 1st link - I've been looking a lot everywhere.

Me.[<Name of subform control>].Form.[<Name of control>].Locked

From your suggestion I again tried and failed with:
me.frm_Participants_subform.form.frm_DataEntry.locked
and:
me.frm_DataEntry.form.frm_Participants_subform.locked

I must not be understanding something. I just want to lock the whole subform, not a particular control on the subform.

where am I going wrong or "not getting it"?

Thanks!




 
The subform (form contained in the subform control) does not have a locked property, but you can lock the subform control:

Code:
Me.frm_Participants_subform.Locked  = False

Or you can set the various properties of the form contained:

AllowAdditions
AllowDeletions
AllowEdits

Code:
Me.frm_Participants_subform.Form.AllowEdits = False



 
Thanks Remou

Neither of these worked exactly, but based on what you sent me and by using the "name" not the "source object" name I'm now back in business.

Thanks again for your patient help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top