| |
csamuels
Posts: 42
Score: 0
Joined: 9/26/2005
Status: offline
|
i would open a ado connection and create a query for each country. dump the contents of each recordset into a html table inside of its own div. make the div name the country. hide all the divs by setting visibiliity to hidden. create a html select box with the country's and make use of the onchange event to the country's div visibility to visible ado connection dim routefile, conn, agentcode, rs, uwdroplist, query dim puw, cuw, plob, clob routefile = "c:\tasks\actagt2.mdb" dim tries set conn = CreateObject("ADODB.Connection") 'prep connection' set rs = CreateObject("ADODB.Recordset") ' prep recordset' tries = 0 ' clear tries counter' do 'try to open connection to the db conn.open "DRIVER={Microsoft Access Driver (*.mdb)};" &_ "DBQ=" & RouteFile & ";DefaultDir=;UID=;PWD=;" tries = tries + 1 if (err.number <> 0) then 'if errored, close this connection conn.close end if Loop While (Err.Number<>0) And tries < 10 'if errored, try again. MAX TRIES = 10 query = "Select * from MYTABLE where AGENT like '" & AgentCode & "%' order by agent" rs.open query, conn if rs.eof then response.write "<font color=red><b>Agent Code " & agentcode & " Not Found</b></font><br>" if not agentcode = "n/a" then response.write "<a href=" & Request.ServerVariables("SCRIPT_NAME") & "?action=add&code=" &_ agentcode & ">Click here to add this code</a>" end if else response.write "<a href=" & Request.ServerVariables("SCRIPT_NAME") & "?action=modify&code=" &_ agentcode & ">Click here to change the UWs</a><br><BR>" %> <table border="1" cellspacing="2" cellpadding="2"> <thead> <tr> <th>Agent Code & LOB</th> <th>UW</th> </tr> </thead> <tbody> <% Do While Not rs.EOF %> <tr> <td><%= rs.Fields("Agent").Value %></td> <td><%= rs.Fields("ENDT").Value %></td> </tr> <% rs.MoveNext Loop %> </tbody> </table> <% end if rs.close set rs = nothing conn.close set conn = nothing visibility // SHOW / HIDE USER INPUTS function select() { //alert(document.values.description.selectedIndex); var desc = "<%= Request.querystring("description") %>"; if (desc == "faxes_sent") { document.getElementById("userid1").style.visibility = "visible"; document.getElementById("userid2").style.visibility = "visible"; } else if (desc == "md_nb_count") { document.getElementById("userid1").style.visibility = "hidden"; document.getElementById("userid2").style.visibility = "hidden"; } }
< Message edited by csamuels -- 2/16/2006 8:54:46 AM >
|
|