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
"McKirahan" wrote:
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:kL********************@comcast.com... "Sanjay" <we*****@mm.com> wrote in message
news:es**************@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.