OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Multiple records from one submit

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Multiple records from one submit
Page: [1]
 
Mav44

 

Posts: 197
Joined: 6/25/2006
Status: offline

 
Multiple records from one submit - 10/5/2009 9:38:02   
I have been reading through the site so I hope I am not duplicating with this question.

My customer would like the add form to have 3 fields under "series" and "part number". The first field is a required value but if something is entered into the second or third fields this would create a completely new record using the same data (name, address, etc) that is on that form except for the line 2 of the two multiple entry items.

Can this be done with some type of loop or by giving the extra field items an id requirement?
Mav44

 

Posts: 197
Joined: 6/25/2006
Status: offline

 
RE: Multiple records from one submit - 10/5/2009 12:26:58   
Doing some reading and it looks like an additional page is the easy answer again. Lots of good info on this topic at http://www.frontpagewebmaster.com/m-187717/key-create%252Cmultiple%252Crecord/tm.htm#187717

I like the BetheBall solution and I have been trying to work on an add code that brings in the repeated data, lets you select the new data and submits to a new record. So far it looks like this but i need some help!

if st = "dup" then
id = request.querystring("id")
sql = "select * from db23 where id = " & id
rsadd.AddNew

region = trim(rs("region"))
distributor = trim(rs("distributor"))
rsadd("series") = series
rsadd("item") = item
city = trim(rs("city"))
state = trim(rs("state"))

rs.close
set rs = nothing
end if

(in reply to Mav44)
Mav44

 

Posts: 197
Joined: 6/25/2006
Status: offline

 
RE: Multiple records from one submit - 10/5/2009 15:22:51   
Yes, I am talking to myself again buit I did want to post my solution.

I added a dup.asp page. On it I have after the connection setting:

if st = "dup" then
id = request.querystring("id")
sql = "select * from db23 where id = " & id
set rs = myconn.execute(sql)

region = trim(rs("region"))
distributor = trim(rs("distributor"))
' t his time I left out the values I want to add for the new record
' this time I left out the values I want to add for the new record
city = trim(rs("city"))
state = trim(rs("state"))

rs.close
set rs = nothing
end if
if st = "add" then 'add new record
Set RSadd=Server.CreateObject("ADODB.RecordSet")
rsadd.Open "Select * From db23", myconn, 3,3

rsadd.AddNew
rsadd("region") = region
rsadd("distributor") = distributor
rsadd("item") = item
rsadd("series") = series
rsadd("city") = city
rsadd("hstate") = state

rsadd.Update
rsadd.close
set rsadd = nothing
esponse.redirect "mainpage.asp"
end if

<%if st = "dup" then%>
<form method="POST" action="dup.asp?st=add">

<%end if%>

then I have my form with these fields and submit button

Hope this saves someone time in the future:)


(in reply to Mav44)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Multiple records from one submit
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts