 |
| ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 27th, 2004, 02:13 PM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
SubForms
How do I create a subform like the Northwind sample Orders form in ACCESS? I have an Orders table thats linked to an Orders_Details table. I want to create a form in where a user can insert multiple records (Order datails) for the order.
|
|

January 29th, 2004, 06:37 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi
Do you need to do this with a data access page, an access form or an ASP form you created?
Regards
Marnus
Such is Life!
|
|

January 29th, 2004, 01:30 PM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oh, sorry how dumb of me not to specify. I want to create this in ASP. You know like sub forms. i heard there not a good idea in ASP, but I need to create something similiar. thanks
|
|

January 29th, 2004, 04:52 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
I wouldn't say they aren't a good idea, it's just complicated.
I looked at the orders form you are talking about. Something like this could most certainly be built. What is your ASP knowledge at this point?
Peter
------------------------------------------------------
Work smarter, not harder.
|
|

January 29th, 2004, 07:20 PM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm pretty much just getting the hang of it. For intance if you give me the right ideas I can follow through witha solution. For instance lets say we have a page that you want to create an order, the user will insert all fields pertaining to the order dates customer name etc. now one order can have many details here is where i was thinking sub form. Im sure what ever advice you give me I'll understand completely.
|
|

January 29th, 2004, 07:58 PM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
From what I under stand I have to pass these values as an Array.
I have a simple SP that inserts a record into a table the Details table. To have these SP work multiple times I would have to pass it as an array correct? I think thats were im stuck.
|
|

January 30th, 2004, 02:19 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Well, you are asking a pretty big question. The answer needs to cover a whole lot of things: relationship of order to the order details, getting the details from the database, rendering the details onto the page, processing the updates, providing capability to add details, and putting those added details into the database.
From a broad perspective, here's what I would do...
Your page is dealing with the details of one order. So you select the current details from the database, and draw those details out to an HTML table. If you want to be able to edit all the details, then you'll need to render the table with the appropriate input mechanisms for each column of the details (text box, select, radio buttons). For adding capability, you would render an additional row that matches all the others, but there's just no data pre-filled into the inputs. When the page is processed, you'll need to handle all the input fields appropriately. The hardest part of this is knowing how to handle a variable number of "rows". If you create each input control with the same name, the posted values will come in as a comma separated list so you can create arrays of the values. Then you can iterate thru each value for each control. So you could go thru the whole set and call your update query to save any changes made. The "add" functionality which added a blank row will have to work a little different. Usually with something like this, I save a hidden input that contains some ID value for each row. When I add the blank input row, that ID value is blank. That way when I'm iterating thru all my values, I can see that the ID is blank and call the insert query instead of the update query.
Unlike getting data, when you are dealing with inserting/updating multiple rows of data you have to deal with each row independently. You can't pass an array (from your ASP scripting language) into a SQL command. You are best to just make multiple calls. You can optimize the code by making multiple commands in one call to the database, but in the end it still comes down to "multiple" SQL commands.
Peter
------------------------------------------------------
Work smarter, not harder.
|
|

February 2nd, 2004, 11:38 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks!
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Subforms |
150563a |
Access |
1 |
June 29th, 2007 04:57 AM |
| Help! With multiple subforms |
dstein4d |
Access |
2 |
February 8th, 2006 06:12 PM |
| subforms |
ajmil11 |
Access |
2 |
January 19th, 2006 11:16 PM |
| Subforms |
V |
Access VBA |
1 |
April 21st, 2004 11:48 AM |
|
 |