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

Subforms like Access

Status
Not open for further replies.

kpereira

Programmer
Jun 29, 2000
33
US
I've searched through help files in VFP6 to find some way to use &quot;sub-forms&quot; as access permits.&nbsp;&nbsp;I found the grid control used in one-to-many forms, but I was trying to use more of a form in a form type of format.&nbsp;&nbsp;Any help, as always, would be appreciate.<br><br>Karen
 
Karen, I'm not an Access developer, though some of the others here might be and can help right away.&nbsp;&nbsp;Even so, can you tell us what the attributes or behavior of a subform is, so we can tell if there is matching VFP feature or workaround? <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Robert,<br>&nbsp;A subform is simply an embedded form on another form. Generally, you use form A to show info on a customer(Name,Address,etc.) and the subform (form B,which is basically just a contained object of form A) would show all orders for that customer. The subform is generally done in gridular format.<br>&nbsp;Personally, I never liked sub-forms because I felt they &quot;cluttered up&quot; the form.<br><br>Karen,<br>&nbsp;What exactly do you mean by &quot;form type of format&quot;? Do you mean having objects in the subform to display your information, ie textboxes,labels,etc?<br><br>Jon
 
If I were working in Access I would have a main form with information from the main table.&nbsp;&nbsp;I want to incorporated a pageframe with tabs for information from different tables.&nbsp;&nbsp;For example, I am working on a database to capture information about Special Ed. Students IEP's(Individual Education Plans).&nbsp;&nbsp;The information about a typical plan would be held in multiple tables.&nbsp;&nbsp;Tables such as
 
If I were working in Access I would have a main form with information from the main table.&nbsp;&nbsp;I want to incorporated a pageframe with tabs for information from different tables.&nbsp;&nbsp;For example, I am working on a database to capture information about Special Ed. Students IEP's(Individual Education Plans).&nbsp;&nbsp;The information about a typical plan would be held in multiple tables.&nbsp;&nbsp;Tables such as &quot;Goals&quot;, &quot;Needs&quot; etc. In following with the student database format I want to keep the information in pages on a given form.&nbsp;&nbsp;<br><br>For example:&nbsp;&nbsp;<br>Main form information at the top of the form.<br>A page tab with Needs Assessment.<br>A page tab with Support Services Information.<br>etc.<br><br>The main student information is kept in this type of format and I wish to be consistent with the database format which the teachers are currently working in.&nbsp;&nbsp;The tab pages have labels and text boxes for the information.&nbsp;&nbsp;<br><br>Is this enough of what you wanted to know?&nbsp;&nbsp;<br><br>Sorry so lengthy.&nbsp;&nbsp;Thanks for your help!<br><br>Karen
 
Hi Karen,<br>&nbsp;&nbsp;As for the length of your post, the more detail you present about your problem, the better the resolution you will receive.<br><br>Robert,<br>&nbsp;&nbsp;It sounds to me like her questions is how to display the data from the child table in a relationship on the same form as the parent table data, and be able to toggle between the child records if many exist in the relationship, without using a grid.<br><br>Karen,<br>&nbsp;&nbsp;As far as I know, there's not an easy way to do this. I would go out on a limb and say you could do this programmatically by placing 2 command buttons on the page, and implementing the supporting code to manipulate the record pointer of the child table.<br><br>Jon
 
I'm not sure what exactly you mean.&nbsp;&nbsp;Is it possible to have the parent table information on a form AND the child table information on the form.&nbsp;&nbsp;Maybe I'm not thinking out of the box enough. I need less Access and more Foxpro on the brain.<br><br>The grid control seems to be the only possible way.<br><br>Thanks for your help everyone!<br><br>Karen
 
Karen,<br>&nbsp;&nbsp;&nbsp;&nbsp;I work in the same field. I keep track of students and their activities by presenting the student demographic information at the top of the form.&nbsp;&nbsp;I then have a tab page lower on the same form.&nbsp;&nbsp;I have a separate tab for each table that I have multple records that pertain to the student.&nbsp;&nbsp;It is actually much easier than ACCESS.&nbsp;&nbsp;I have taught and worked with ACCESS for many years, and while there are nice features in the subform, the grid in FoxPro is much easier to work with in most cases.&nbsp;&nbsp;If there is a way to get a copy of my program to you, I would be glad to share.&nbsp;&nbsp;This my first reply on this forum, so I don't know a;; the rules to sharing, but since I work in an educational institution, I believe my programs should be available in the public domain.<br>
 
Seems to me that this topic deserves a place in the FAQ section.&nbsp;&nbsp;I'd like to see more detailed discussion and actual code.
 
Have you considered using a browse window with:<br><br>SELECT parent_table<br>SET RELATION TO join_field INTO child_table<br>SET SKIP TO child_table<br><br>BROWSE FIELDS parent_table.field1, parent_table.field2, child_table.field1,...etc.<br><br>(or you could set up individual browse windows for each table and the child tables will show the records associated with the active record in the parent table.<br><br>You could place a command button on your form and in the click event you would set up the relationship and the browse parameters.<br><br>This really isn't what you were asking for, but it may be another way for you to accomplish what it appears you are trying to do.
 
To answer Karen's core question, the answer is a page frame with 2 or more pages.&nbsp;&nbsp;Page frames and their contained pages are container objects in VFP, and seemingly would be analgous to how you describe an Access subform.<br><br>Each page could contain various kinds of controls, including grids where appropriate. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
WOW talk about a great response.<br><br>Thank you all for your input.&nbsp;&nbsp;I will have to give it all a serious look now.&nbsp;&nbsp;<br><br>I do have one question for foxdev, though.&nbsp;&nbsp;If I use page frames, how do I link the data from the main(parent) form to the data from the sub-form(child).&nbsp;&nbsp;I see how this is accomplished with grids, but I am unclear how to do this with text boxes.<br><br>BruceFla, I would love to take a look at your program.&nbsp;&nbsp;I normally work in Access, but our current software is in FoxPro, so I'm working with the current program.&nbsp;&nbsp;I would find it quite interesting to see what you are working with.&nbsp;&nbsp;I am not sure how to go about contacting each other.&nbsp;&nbsp;You could email me at <A HREF="mailto:klp63_99@yahoo.com">klp63_99@yahoo.com</A>.&nbsp;&nbsp;I look forward to hearing from you.<br><br>Again, thank you all for the input.&nbsp;&nbsp;I will let you know what I do with the information.<br><br>Karen
 
<font color=blue>If I use page frames, how do I link the data from the main(parent) form to the data from the sub-form(child).&nbsp;&nbsp;I see how this is accomplished with grids, but I am unclear how to do this with text boxes.</font><br><br>Its no different than if they were on the same form/page.&nbsp;&nbsp;They're all on the same form (the <font color=green>ThisForm</font> reference on any page will still refer to the same parent), its just that you've added a pageframe to a portion of it to allow multiple tabs.<br><br>Simple example:<br>You have a table Customer.&nbsp;&nbsp;On the top of your form you have the customer's name from various fields of Customer.&nbsp;&nbsp;Below that, you've created a pageframe with three pages: page1 captioned address, page2 captioned phone numbers, and page3 captioned other.<br><br>No matter what page they are on, the name is visible, because it is on the main form above the pageframe.&nbsp;&nbsp;You drop the textboxes for Address, City, State, etc onto the page1, and miscellaneous other fields in text boxes on page3.&nbsp;&nbsp;For page2, you could put in a grid that uses (for example) the result of an SQL SELECT to pull multiple phone numbers from a separate PhoneNum table.<br><br>All this to say that you can mix and match types of controls on pages of a pageframe just like you would on a plain form.&nbsp;&nbsp;Just remember that if you need to reference a control on a page from outside that page, be sure to use the full object reference, such as ThisForm.PageFrame1.Page3.MyTextBox.&nbsp;&nbsp;As an aid, you can right-click and choose Object reference from the context menu in any form method editing window. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
SUPER Robert!&nbsp;&nbsp;Thanks!&nbsp;&nbsp;That explains exactly what I need.<br><br>Karen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top