Home All Groups Group Topic Archive Search About

Save all values from a form



Author
29 Mar 2006 6:23 PM
Sanjay
Hi,

Is it possible to save all the names/values of a form to another memo
textfield before a Insert to the database then when required on another page
split that memo textfield into the name and their corresponding values
retrieved from the recordset ?

Thanks,

Sanj

Author
29 Mar 2006 7:07 PM
Ray Costanzo [MVP]
Of course it'd be possible, but why go through the extra process of joining
things together and then split them back up again?

Ray at work

Show quote
"Sanjay" <webu***@mm.com> wrote in message
news:estgm31UGHA.5900@tk2msftngp13.phx.gbl...
> Hi,
>
> Is it possible to save all the names/values of a form to another memo
> textfield before a Insert to the database then when required on another
> page
> split that memo textfield into the name and their corresponding values
> retrieved from the recordset ?
>
> Thanks,
>
> Sanj
>
>
Author
29 Mar 2006 7:39 PM
McKirahan
"Sanjay" <webu***@mm.com> wrote in message
news:estgm31UGHA.5900@tk2msftngp13.phx.gbl...
> Hi,
>
> Is it possible to save all the names/values of a form to another memo
> textfield before a Insert to the database then when required on another
page
> split that memo textfield into the name and their corresponding values
> retrieved from the recordset ?


This will do (something like) it server-side:

<%
For Each item In Request.Form
    memo = memo & item & "=" & Request.Form(item)
Next
%>

But it sounds like you want to do it client-side
to populate another form field; (i.e. <textrea>).
If so, that's a question for another newsgroup.
Author
29 Mar 2006 7:45 PM
McKirahan
Show quote
"McKirahan" <N***@McKirahan.com> wrote in message
news:kLSdnbsNUP0Qf7fZRVn-gw@comcast.com...
> "Sanjay" <webu***@mm.com> wrote in message
> news:estgm31UGHA.5900@tk2msftngp13.phx.gbl...
> > Hi,
> >
> > Is it possible to save all the names/values of a form to another memo
> > textfield before a Insert to the database then when required on another
> page
> > split that memo textfield into the name and their corresponding values
> > retrieved from the recordset ?
>
>
> This will do (something like) it server-side:
>
> <%
> For Each item In Request.Form
>     memo = memo & item & "=" & Request.Form(item)
> Next
> %>

Below I added "& vbCrLf" to separate each field's name=value pair.

<%
For Each item In Request.Form
    memo = memo & item & "==" & Request.Form(item) & vbCrLf
Next
%>


You would then use
    item =Split(memo,vbCrLf)
to get each name=value pair then use
    what = Split(item,"==")
to get each name and value from an item.

Of course you didn't indicate that you wanted the "name"
of each field just its "value".  Adjust accordingly.
Author
29 Mar 2006 10:35 PM
sanj
Thanks for replying, let me explain the reason for this first:

I have a form (1 form of 8) with approx 60 textfields, I need to save the
values which are returned from various recordsets and calculations using VB
when the page is executed. The user after completing all the forms the user
sets another value on another page (which could be completed a week etc)
which is inserted into a database, so my thought was to save all the values
from the form in a memo textfield in the database instead of creating a field
for each textfield, then after the user has set the other value split the
memo textfield and conduct the extra calculations required based on the
additional set value and resave the all to the database again.

This way I can keep the database small without creating all the fields in
the database for each form - I don't need to report/search on the values in
the memo textfield.

Your solution is perfect so thanks for this, could I ask one question:

e.g.
my memo textfield is like the following using your solution:
productID1==LB5284/3 productID2==6491B710G/Y productID3==KCL10-10

when I retrieve the value from a recordset I would like to using VB to:

productID1 = LB5284/3
productID2 = 6491B710G/Y
productID3 = KCL10-10


I'm trying to follow your split function by using Response.Write:

<%
item = Split(session ("memo"),vbCrLf)
what = Split(item,"==")
Response.Write(what)
%>

Regards,

Sanj

Show quote
"McKirahan" wrote:

> "McKirahan" <N***@McKirahan.com> wrote in message
> news:kLSdnbsNUP0Qf7fZRVn-gw@comcast.com...
> > "Sanjay" <webu***@mm.com> wrote in message
> > news:estgm31UGHA.5900@tk2msftngp13.phx.gbl...
> > > Hi,
> > >
> > > Is it possible to save all the names/values of a form to another memo
> > > textfield before a Insert to the database then when required on another
> > page
> > > split that memo textfield into the name and their corresponding values
> > > retrieved from the recordset ?
> >
> >
> > This will do (something like) it server-side:
> >
> > <%
> > For Each item In Request.Form
> >     memo = memo & item & "=" & Request.Form(item)
> > Next
> > %>
>
> Below I added "& vbCrLf" to separate each field's name=value pair.
>
> <%
> For Each item In Request.Form
>     memo = memo & item & "==" & Request.Form(item) & vbCrLf
> Next
> %>
>
>
> You would then use
>     item =Split(memo,vbCrLf)
> to get each name=value pair then use
>     what = Split(item,"==")
> to get each name and value from an item.
>
> Of course you didn't indicate that you wanted the "name"
> of each field just its "value".  Adjust accordingly.
>
>
>
Author
30 Mar 2006 1:47 AM
McKirahan
Show quote
"sanj" <s***@discussions.microsoft.com> wrote in message
news:E26129CF-6558-42B2-A7C6-C5A223A264DA@microsoft.com...
> Thanks for replying, let me explain the reason for this first:
>
> I have a form (1 form of 8) with approx 60 textfields, I need to save the
> values which are returned from various recordsets and calculations using
VB
> when the page is executed. The user after completing all the forms the
user
> sets another value on another page (which could be completed a week etc)
> which is inserted into a database, so my thought was to save all the
values
> from the form in a memo textfield in the database instead of creating a
field
> for each textfield, then after the user has set the other value split the
> memo textfield and conduct the extra calculations required based on the
> additional set value and resave the all to the database again.
>
> This way I can keep the database small without creating all the fields in
> the database for each form - I don't need to report/search on the values
in
> the memo textfield.
>
> Your solution is perfect so thanks for this

You're welcome.

, could I ask one question:
Show quote
>
> e.g.
> my memo textfield is like the following using your solution:
> productID1==LB5284/3 productID2==6491B710G/Y productID3==KCL10-10
>
> when I retrieve the value from a recordset I would like to using VB to:
>
> productID1 = LB5284/3
> productID2 = 6491B710G/Y
> productID3 = KCL10-10
>
>
> I'm trying to follow your split function by using Response.Write:
>
> <%
> item = Split(session ("memo"),vbCrLf)
> what = Split(item,"==")
> Response.Write(what)
> %>

Try changing it a little:

<%
what = Replace(Session ("memo"),"=="," = ")
Show quote
Response.Write("<pre>" & what & "</pre>")
%>
Author
30 Mar 2006 12:11 PM
sanj
Yes that's great thanks again.

Regards,

Sanj

Show quote
"McKirahan" wrote:

> "sanj" <s***@discussions.microsoft.com> wrote in message
> news:E26129CF-6558-42B2-A7C6-C5A223A264DA@microsoft.com...
> > Thanks for replying, let me explain the reason for this first:
> >
> > I have a form (1 form of 8) with approx 60 textfields, I need to save the
> > values which are returned from various recordsets and calculations using
> VB
> > when the page is executed. The user after completing all the forms the
> user
> > sets another value on another page (which could be completed a week etc)
> > which is inserted into a database, so my thought was to save all the
> values
> > from the form in a memo textfield in the database instead of creating a
> field
> > for each textfield, then after the user has set the other value split the
> > memo textfield and conduct the extra calculations required based on the
> > additional set value and resave the all to the database again.
> >
> > This way I can keep the database small without creating all the fields in
> > the database for each form - I don't need to report/search on the values
> in
> > the memo textfield.
> >
> > Your solution is perfect so thanks for this
>
> You're welcome.
>
> , could I ask one question:
> >
> > e.g.
> > my memo textfield is like the following using your solution:
> > productID1==LB5284/3 productID2==6491B710G/Y productID3==KCL10-10
> >
> > when I retrieve the value from a recordset I would like to using VB to:
> >
> > productID1 = LB5284/3
> > productID2 = 6491B710G/Y
> > productID3 = KCL10-10
> >
> >
> > I'm trying to follow your split function by using Response.Write:
> >
> > <%
> > item = Split(session ("memo"),vbCrLf)
> > what = Split(item,"==")
> > Response.Write(what)
> > %>
>
> Try changing it a little:
>
> <%
> what = Replace(Session ("memo"),"=="," = ")
> Response.Write("<pre>" & what & "</pre>")
> %>
>
>
>

AddThis Social Bookmark Button