Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Value from Recordset to base update or insert on

Status
Not open for further replies.

jofarrell

Programmer
Mar 21, 2001
178
US
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 &quot;<input type='button' name='SubmitData' value='Submit Data' onClick='dataupdate(this.form, StudyId)'>&quot;

<Java script function>

function dataupdate(form,svalue)
{
if StudyID >0 {
fUpdate=true;
document.cookie = Identifier + &quot;=&quot; + 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top