By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,696 Members | 2,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,696 IT Pros & Developers. It's quick & easy.

how to solve this?

P: n/a
Hi,

In 'test.htm', there are two Select, one visible, the other invisible. The
second becomes visible only if the number of records in a Access table <2.
There is also a button to start the VB-procedure. I choose first a value
into the first Select (sel1), then i click on the button to start
VB-procedure. If the value="a", then get the number of records in a table of
Access. So i made a INPUT within a form and go to test2.asp which gets the
number of records ('tot') i need.

My problem is now: how to get back to 'test.htm' with the number of records
('tot') in order to test that number and to make or not the second Select
visible?
I can do this using RDS, because then everything can be put in VB, but i
want to solve this without RDS.
Thanks for any help.
andré

file 'test.htm':
<SELECT name=sel >
<option value="a" > a
<option value="b" > b
</SELECT>
<SELECT name=sel2 style="visibility:hidden">
<option value="c" > c
<option value="d" > d
</SELECT>

<INPUT name=reg TYPE="button" value="test">

<form name=ins>
<input name="rpc" type="hidden" value="" >
</form>

<script language=vbscript>
sub reg_onclick()
value=sel.value
if value="a" then
document.getElementById("rpc").value=a
ins.action="test2.asp"
ins.method="post"
ins.submit
end if

if 'tot' obtained in test2.asp >=2 then
msgbox ("you have already 2 items .. whatever .....")
else
sel2.style.visibility="visible"
.....
end if
end sub
</script>

file 'test2.asp':
<%
set objdc = Server.CreateObject("ADODB.Connection")
objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
=d:\access\newres.mdb")
sql="select items from mytable;"
set rs=Server.CreateObject("ADODB.recordset")
rs.open sql, objdc, 3, 3
tot=rs.recordcount
%>

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.