![]() This syntax makes sense in our application since each case performs a simple variable assignment and the code is clean and easily readable. ![]() Notice the tight code method used in the Select Case statement. Me.objSubform.Height = 0.75 * Me.tabPublisher.Height Me.objSubform.Width = 0.95 * Me.tabPublisher.Width Me.objSubform.LinkMasterFields = "pub_id" Me.objSubform.SourceObject = strSubformName ' If a subform exists, then set the properties, otherwise ' Based on the page selected, set the Subform Name variableĬase 1: strSubformName = "sfrmAdditionalInfo"Ĭase 2: strSubformName = "sfrmEmployeeInfo"Ĭase 3: strSubformName = "sfrmPublisherTitles" Check out the code, and keep in mind this is all the code in the entire application. Once I corrected that issue, things proceeded pretty smoothly. Needless to say, it did not behave as I had intended. When I was preparing the code for this article, I instinctively selected the Click() event instead of the Change() event. If there is a trick, it is knowing which event receives the code. The code for this process is very, very simple. Through code, it is dynamically resized, moved and loaded with the correct subform, depending on which page is selected. Let's take a look at the code that manipulates this simple control. There is one unbound Subform object floating around in the upper right-hand corner where it appears out of place. However, as you can see from the design-view image of the form below, there aren't any subforms embedded on these tab-pages. ![]() The first page has fields of the master form embedded in it while the other three pages will reference its corresponding subform. ![]() My form has a tab control with four pages, one for each of the tables referenced. That is what this month's article is all about and as usual, the code is available in the download file. So, how do you get around this performance hit? Simple don't load any data until the user actually asks to see it. Before long, they have a dozen subforms pointing to a dozen related tables referencing thousands of related records. Once a developer gets started creating subforms, they often don't know when to quit. The down side is that it is too simple to add subforms. Set the Link Master Field and Link Child Field properties Drag child form and drop on master formĤ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |