Thanks again for your response japshire. Your last response was successful in getting a sub to execute with the press of a button.
I have the following code(including how you demonstrated how to get a button to execute a sub) on an ASP page:
What I want the button to do is execute the sub "fillfields" when it is clicked. Any ideas on how to accomplish that would be greatly appreciated.Code:<html> <head> <Script type="text/vbscript"> Sub Test1 Document.Write("Hello from Test1!") End Sub </script> <title>CSTools - Organizations</title> </head> <body> <% Dim strConnect, strCompanyName Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.RecordSet") strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("cstoolsdb.mdb") objConn.open strConnect strcompanyname = request.querystring("companyinfo") objRS.open "SELECT * FROM tblcompanies WHERE companyname = '" & strcompanyname & "'",objConn %> <%fillfields%> <%Sub fillfields%> <p align="center"><font size="6"><b><u><%=request.querystring("companyinfo")%></u></b></font></p> <p><font size=4><b>Catagory:</b> <%=objRS("catagory")%></font></p> <p><font size=4><b>ID:</b> <%=objrs("id")%></font></p> <p><font size=4><b>Billing Address:</b> <%=objrs("billingaddress")%> <b>Shipping Address:</b> <%=objrs("shippingaddress")%></font></p> <p><font size=4><b>City:</b> <%=objrs("city")%></font></p> <p><font size=4><b>State\Province</b> <%=objrs("stateorprovince")%></font></p> <p><font size=4><b>Postal Code:</b> <%=objrs("postalcode")%></font></p> <p><font size=4><b>Country:</b> <%=objrs("country")%></font></p> <p><font size=4><b>Modem:</b> <%=objrs("modemphoneno")%></font></p> <p><font size=4><b>Suffix:</b> <%=objrs("suffix")%> <b>Logon:</b> <%=objrs("logon")%> <b>Password:</b> <%=objrs("password")%></font></p> <p><font size=4><b>Navy Issues:</b> <%=objrs("navyissues")%> <b>Associate Membership:</b> <%=objrs("associatemembership")%></font></p> <%End Sub%> <% objRS.close set objRS = Nothing objConn.close set objConn = Nothing %> <button onclick="Test1">Test1</button> </body> </html>




Reply With Quote