July 8, 2014 at 9:36 am
I have a form that has a Tab Control with 10 tabs. Each tab has a subform. I am dynamically creating these forms from template forms I have. I make a copy of the main form and 10 subforms that are in each tab. I want to be able to rename the sourceobject of each subform in each tab. I tried renaming the sourceobject and Name of the subform from the main form, but It is not working. I think I need to put the Tab control name somewhere in here but not sure where?
MyFormName = The name of the main form
MyTemplateName = The current name of the subform
mysubformsNew = The New name of the subform I want to give to the subform
'The name of my Tab Control is "TabMain"
'This is what I am trying
Forms(MyFormName).Controls(MyTemplateName).Form.SourceObject = MySubFormsNew
Forms(MyFormName).Controls(MyTemplateName).Form.Name = MySubFormsNew
July 8, 2014 at 12:58 pm
I found the correct syntax:
Forms(MyFormName).Controls(MyTemplateName).SourceObject = MySubFormsNew
Forms(MyFormName).Controls(MyTemplateName).Name = MySubFormsNew
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy