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!

Master/Detail forms 2

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
I am just getting started building an application and have not been able to find many resources (in fact any) that describe how to create a master detail type of form using Visual Interdev.&nbsp;&nbsp;So far I really like the product although I have not done any &quot;hard stuff&quot; yet so I would also like to ask if anyone knows of any resources that I can access that can give me some of the more advanced pieces of the puzzle. <br>
 
&quot;Master Detailed type of form&quot;? :? <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Re: master detailed?<br>A master/detail form (in Access it would be a form and subform linked with master and child fields).&nbsp;&nbsp;I would like to represent a one to many database relationship, and have the ability to allow data entry to both of the tables.&nbsp;&nbsp;This is very easy for me in the other development environments I have used but I have been unable to find any references for how to do it in Visual Interdev.
 
Visual Interdev creates web applications, it doesnt create a Visual Application like you would write in VB or VBA, you'll have to manually set that up, throwing on your own HTML controls and what not, then using VBscript(Server-side) to populate that information before sending it back to the WebBrowser. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Dear crystalized,<br><br>Yes VID makes it extremely easy to build master/detail pages... once you get the hang of working with VID and all it's power. Just like programming environment you need to start at 'YOUR' level. If your a beginner, start there, don't jump in over your head &lt;nuf said&gt;<br><br>So master/detail basics would be like this:<br><br>1) New Project<br>2) Create a Database connection for the project<br>3) New ASP Page ( masterlist.asp)<br>4) Drag and drop a recordset DTC onto the page<br>5) Set up the properties of the DTC.Recordset object<br>6) Drag and drop a grid DTC onto the page<br>7) Point the grid's recordsource to the DTC.Recordset object<br>8) Set up the remaining properties in the DTC.Grid object including the following:<br>&nbsp;&nbsp;a) First column contains a call to a function for it's source that returns an HTML 'anchor' tag that points to the 'detailrecord.asp' page and sets a parameter like ID = the current records ID column value<br><br>***** Master page is done<br>9) New ASP Page ( detailrecord.asp)<br>10) Drag and drop a recordset DTC onto the page<br>11) Set up the properties of the DTC.Recordset object<br>12) Create a onbeforeload() member handler for the DTC.Recordset object which does the following:<br>&nbsp;&nbsp;a) Set the .SQL property of the DTC.Recordset object to a SQL statement that will point to the record indicated by the 'ID' parameter in the QueryString that was passed by the masterlist.asp page. i.e., &quot;Select * from mytable where id = &quot; + Request(&quot;ID&quot;)<br><br>1_) no number thir___een ;o)<br>14) Drag and Drop any and all the Databound DTC controls you need to display the column values of your recordset.<br>15) Set the datasource property of each to the DTC.Recordset object<br>16) Set the remaining properties of each data bound control<br>17) Finish programming the rest of the detail page to perform the functions you desire, i.e., Update the record -&nbsp;&nbsp;Delete the record - Create a new record.<br>18) Finish the pages by creating all the visual effects you desire now that the functional code is complete.<br><br>Hope this helps<br>-pete<br><br>
 
Thanks Palbano<br>I hope that is going to help me out, although after spending my day doing internet research I admit I am incapable of attempting it today.&nbsp;&nbsp;I will post to let you know how it goes.
 
one other little tip, it may help you , but in my opinion I dont like DataBound controls or Design time controls, so watch out for those (unless it suits you very well) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Karl,<br><br>&gt; but in my opinion I dont like DataBound controls or Design time controls, <br><br>Could you please elaborate on that... why don't you like them?<br><br>-pete
 
Hello,<br>I am Abhi from Baroda, Gujarat, India.&nbsp;&nbsp;Your question is one which had intrigued me also in my early days of vid 6.0 use.&nbsp;&nbsp;What you can do is go to <A HREF=" TARGET="_new"> and find a sample of an updateable grid.&nbsp;&nbsp;Now using this and a bit of your imagination you can build master detail forms in asp.&nbsp;&nbsp;What you can do is use html bookmarks to give it a different look also
 
Thanks for the tip Abhi :)<br><br>I am wondering now as far as the grids go, how do you make them show up when there is no current data to be displayed.&nbsp;&nbsp;I want to use the grid to add new records but when I view the page with the grid when there are no records to display the grid is not there.&nbsp;&nbsp;Am I just doing something wrong, or is that the usual way it works.<br><br> <p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
 
Dear Crystal,<br><br>The DTC Grid control generates HTML &lt;Table&gt; tags for the browser. It may not be generating any tags when there are no rows of data in the bound recordset.<br><br>Is this a problem for you?<br><br>-pete
 
Dear Palbano<br><br>Maybe if I explain exactly what I am trying to do I can more accurately explain my problem.<br><br>I am trying to create a form that will allow a logged in member to create (for lack of a better term) a member profile.&nbsp;&nbsp;The member profile is quite extensive (so I am thinking of using several separate forms) and requires data to be input into several SQL Server database tables.&nbsp;&nbsp;One of the requirements is to allow the user to enter a variable number of phone numbers (although we could impose an arbitrary limit to the number of phone numbers allowed). <br><br>Now since this user is coming into this form with no previous data entered (this will be an add profile only form), when they reach the phone numbers form they would be greeted with a blank page (except for the form navigation buttons I have added) if I use the grid control.<br><br>Any words of wisdom you can offer would be greatly appreciated especially for the grid part.&nbsp;&nbsp;I have found an article detailing a updateable grid (not a DTC but rather an ASP code grid) that looks like it might work.&nbsp;&nbsp;However being a newcomer to ASP I am a little unsure of myself and concerned over the changes I might have to make to it.<br><br>Thanks for all your previous advice on the topic. <p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
 
Now I think your goal is crystal clear. sorry couldn't help myself.<br><br>Well I can only offer my 'opinion' on this. I would use client side script to allow the user to add as many phone numbers as he wants (that is how I understand your criteria). The form where this happens needs to have the following items:<br><br>*Edit box for typing in a phone number(s)<br>*button for adding the phone number<br>*List box to add the phone number(s) into for display<br>*hidden form element that the phone numbers get added into using a pipe character as separator.<br>*script(s) to do all the work when the 'Add' button is pressed<br><br>Now when the form is submitted the hidden form variable string is built (client side) from the list box entries using the pipe character as a delimiter. Then on the server the Request object has a string of pipe '¦' separated phone numbers, easily parsed and inserted into a table.<br><br>Things you might also want on the above form:<br>*Remove button allows the user to remove a phone number from the list before submitting<br>*Edit button which overwrites the currently selected list entry with the current contents of the edit box.<br><br>&quot;But, that's just my opinion... I could be wrong&quot;.<br>-pete
 
Thanks (not) for the pun<br>but thanks a lot for the info, I am not sure how to do the scripting part of it, but right now I am in the basic prototype phase (nothing works), but at least with the idea you mentioned I can make the &quot;This is what it looks like page&quot; <p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
 
I know I am probably becoming a huge pain, but is there a way to initialize the width of the list box so that I don't get that stupid looking tall skinny list box? <p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
 
Crystal,<br><br>&gt; I know I am probably becoming a huge pain<br><br>No way, I'm the pain around here... just ask anyone! ;o)<br><br>&gt; is there a way to initialize the width of the list box <br><br>That's not part of the HTML spec. Usually we just resort to doing something like putting a single item as element zero with some hopefully relevant text that we know to ignore as real data. In your case you might put something like 'Phone Numbers'.<br><br>Hope this helps<br>-pete<br>
 
It does I had actually come to a similar idea (what do you know I finally used my own brain instead of yours).<br><br>Now as to the whole hidden field with the pipe separators, what can I do if the list I am adding to is now not just simple phone numbers but rather consists of several fields.<br><br>For example an &quot;Education&quot; entry consisting of Year,College,degree, etc.&nbsp;&nbsp;Is there any easy way to handle these kind of data entry routines? <p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
 
Well the previous technique is for a many to one situation, i.e., you have many phone numbers for one user.<br><br>That's not the same for the education data is it? Even if a single user could have several Education rows the data of the row is still one to one. So you just create an education form with an Add button. Each field has an edit box and Add creates a new row in the Education table. Then you can let them add multiple rows or not, but using the same form again to add the second, third etc. rows. So I guess that's more of a master/detail scenario.<br><br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top