When I save data into an access database I use an autonumber so I can pull corresponding data from two tables and populate a dynamic table on my ASP page.
They enter two dates, if a recordset exists I save the value of the Primary Key
StudyID = rsFill("Identifier"
Based on if this exists I know whether to update data or insert new data .. Insert works fine, the problem is that when I reload my form my variable resets and it shows up as "". On the click of get previous data I did a response.write of the variable .. its there up until my Submit button .. which I have changed types as a button and I call a function.
<VB script - just to let you know>
Response.Write "<input type='button' name='SubmitData' value='Submit Data' onClick='dataupdate(this.form, StudyId)'>"
<Java script function>
function dataupdate(form,svalue)
{
if StudyID >0 {
fUpdate=true;
document.cookie = Identifier + "=" + escape(svalue);
form.submit();
}
else {
fUpdate=true;
form.submit();
}
}
I tried handing that value to the function but it doesnt seem to work .. any suggestions?
Thank you in advance
They enter two dates, if a recordset exists I save the value of the Primary Key
StudyID = rsFill("Identifier"
Based on if this exists I know whether to update data or insert new data .. Insert works fine, the problem is that when I reload my form my variable resets and it shows up as "". On the click of get previous data I did a response.write of the variable .. its there up until my Submit button .. which I have changed types as a button and I call a function.
<VB script - just to let you know>
Response.Write "<input type='button' name='SubmitData' value='Submit Data' onClick='dataupdate(this.form, StudyId)'>"
<Java script function>
function dataupdate(form,svalue)
{
if StudyID >0 {
fUpdate=true;
document.cookie = Identifier + "=" + escape(svalue);
form.submit();
}
else {
fUpdate=true;
form.submit();
}
}
I tried handing that value to the function but it doesnt seem to work .. any suggestions?
Thank you in advance