Advertisement

12.04.2007 at 04:38PM PST, ID: 23001901
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Maintaining selected "item" in selection list from record set

Asked by SamuelClemmons in VB Controls, MS SQL Server, Macromedia Dreamweaver

Tags: , ,

I have drop down boxes which have a number of selections. I want the last selection a user makes to stay "selected" as we often have similar items to enter into our database. My page follows:

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<!--#include file="Connections/veneermove.asp" -->
<%
Dim rs_loaction
Dim rs_loaction_numRows
 
Set rs_loaction = Server.CreateObject("ADODB.Recordset")
rs_loaction.ActiveConnection = MM_veneermove_STRING
rs_loaction.Source = "SELECT *  FROM dbo.tbl_location  ORDER BY LocationNum ASC"
rs_loaction.CursorType = 0
rs_loaction.CursorLocation = 2
rs_loaction.LockType = 1
rs_loaction.Open()
 
rs_loaction_numRows = 0
%>
<%
Dim rs_status
Dim rs_status_numRows
 
Set rs_status = Server.CreateObject("ADODB.Recordset")
rs_status.ActiveConnection = MM_veneermove_STRING
rs_status.Source = "SELECT * FROM dbo.tbl_status"
rs_status.CursorType = 0
rs_status.CursorLocation = 2
rs_status.LockType = 1
rs_status.Open()
 
rs_status_numRows = 0
%>
<%
Dim rs_Supplier
Dim rs_Supplier_numRows
 
Set rs_Supplier = Server.CreateObject("ADODB.Recordset")
rs_Supplier.ActiveConnection = MM_veneermove_STRING
rs_Supplier.Source = "SELECT supplier_name FROM dbo.tbl_suppliers ORDER BY supplier_name ASC"
rs_Supplier.CursorType = 0
rs_Supplier.CursorLocation = 2
rs_Supplier.LockType = 1
rs_Supplier.Open()
 
rs_Supplier_numRows = 0
%>
<%
Dim rs_Grades
Dim rs_Grades_numRows
 
Set rs_Grades = Server.CreateObject("ADODB.Recordset")
rs_Grades.ActiveConnection = MM_veneermove_STRING
rs_Grades.Source = "SELECT grade FROM dbo.tbl_grades"
rs_Grades.CursorType = 0
rs_Grades.CursorLocation = 2
rs_Grades.LockType = 1
rs_Grades.Open()
 
rs_Grades_numRows = 0
%>
<%
Dim rs_Thickness
Dim rs_Thickness_numRows
 
Set rs_Thickness = Server.CreateObject("ADODB.Recordset")
rs_Thickness.ActiveConnection = MM_veneermove_STRING
rs_Thickness.Source = "SELECT thickness FROM dbo.tbl_thickness ORDER BY thickness ASC"
rs_Thickness.CursorType = 0
rs_Thickness.CursorLocation = 2
rs_Thickness.LockType = 1
rs_Thickness.Open()
 
rs_Thickness_numRows = 0
%>
<%
Dim rs_Quantity
Dim rs_Quantity_numRows
 
Set rs_Quantity = Server.CreateObject("ADODB.Recordset")
rs_Quantity.ActiveConnection = MM_veneermove_STRING
rs_Quantity.Source = "SELECT quantity_count FROM dbo.tbl_scarf_count ORDER BY quantity_count ASC"
rs_Quantity.CursorType = 0
rs_Quantity.CursorLocation = 2
rs_Quantity.LockType = 1
rs_Quantity.Open()
 
rs_Quantity_numRows = 0
%>
<%
' WA Application Builder Insert
if (cStr(Request.Form("Insert.x")) <> "")  then
  WA_connection = MM_veneermove_STRING
  WA_table = "dbo.tbl_RM_Materials"
  WA_sessionName = "WADA_Insert_dbotbl_RM_Materials"
  WA_redirectURL = "tbl_RM_Materials_Insert_Scarf.asp"
  WA_keepQueryString = false
  WA_indexField = "RM_ID"
  WA_fieldNamesStr = "RM_BCODE|RM_DateTime|RM_PurchOrd|RM_Location|RM_Supplier|RM_Grade|RM_Thickness|RM_Quantity|RM_Status|RM_Product"
  WA_fieldValuesStr = "" & cStr(cStr(Request.Form("RM_BCODE"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_DateTime"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_PurchOrd"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Location"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Supplier"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Grade"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Thickness"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Quantity"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Status"))) & "" & "|" & "" & cStr(cStr(Request.Form("RM_Product"))) & ""
  WA_columnTypesStr = "',none,''|',none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''"
  WA_comparisonStr = " LIKE | = | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE "
  WA_fieldNames = Split(WA_fieldNamesStr,"|")
  WA_fieldValues = Split(WA_fieldValuesStr,"|")
  WA_columns = Split(WA_columnTypesStr,"|")
  WA_comparisions = Split(WA_comparisonStr, "|")
 
  insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
  set MM_editCmd = Server.CreateObject("ADODB.Command")
  MM_editCmd.ActiveConnection = WA_connection
  MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" & insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")"
  MM_editCmd.Execute()
  MM_editCmd.ActiveConnection.Close()
  obj = WA_AB_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues, WA_comparisions)
  sqlstr = "SELECT " & WA_indexField & " FROM " & WA_table & " WHERE " &  obj & " ORDER BY " & WA_indexField & " DESC"
  set WA_AppBuilderRecordset = Server.CreateObject("ADODB.Recordset")
  WA_AppBuilderRecordset.ActiveConnection = WA_connection
  WA_AppBuilderRecordset.Source = sqlstr
  WA_AppBuilderRecordset.CursorType = 0
  WA_AppBuilderRecordset.CursorLocation = 2
  WA_AppBuilderRecordset.LockType = 1
  WA_AppBuilderRecordset.Open()
  if (NOT WA_AppBuilderRecordset.EOF)  then  Session(WA_sessionName) = WA_AppBuilderRecordset.Fields.Item(WA_indexField).Value
  WA_AppBuilderRecordset.Close()
  if (WA_redirectURL <> "")  then
    if (WA_keepQueryString AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
      if (inStr(WA_redirectURL,"?") > 0)  then
        WA_redirectURL = WA_redirectURL & "&"
      else
        WA_redirectURL = WA_redirectURL & "?"
      end if
      WA_redirectURL = WA_redirectURL & Request.QueryString
    end if
    Response.Redirect(WA_redirectURL)
  end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Insert tbl_RM_Materials</title>
<link href="WA_DataAssist/styles/Modular_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #EBD7FF;
}
.style2 {font-size: 16px}
.style3 {
	color: #FF0000;
	font-style: italic;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
 
<body onload="document.forms['WADAInsertForm'].RM_BCODE.focus();">
 
<div id="Layer1" style="position:absolute; left:350px; top:145px; width:237px; height:21px; z-index:1"><strong><span class="style2">SCARF SAW INSERTION PAGE </span></strong></div>
<div class="WADAInsertContainer">
  <form action="tbl_RM_Materials_Insert_Scarf.asp" method="post" name="WADAInsertForm" id="WADAInsertForm">
    <div class="WADAHeaderText">Make selections first, then scan barcode to submit</div>
    <table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
      <tr>
        <th class="WADADataTableHeader"><div align="left">BCODE:</div></th>
        <td class="WADADataTableCell"><input type="text" name="RM_BCODE" id="RM_BCODE" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Date Time:</div></th>
        <td class="WADADataTableCell"><input type="text" readonly name="RM_DateTime" id="RM_DateTime" value="<%response.write( now())%>" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"></th>
        <td class="WADADataTableCell"><input type="hidden" readonly name="RM_PurchOrd" id="RM_PurchOrd" value="<%=request.form("RMPo")%>" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Location:</div></th>
        <td class="WADADataTableCell">
          <select name="RM_Location">
            <%
While (NOT rs_loaction.EOF)
%>
            <option value="<%=(rs_loaction.Fields.Item("LocationNum").Value)%>"><%=(rs_loaction.Fields.Item("LocationNum").Value)%></option>
            <%
  rs_loaction.MoveNext()
Wend
If (rs_loaction.CursorType > 0) Then
  rs_loaction.MoveFirst
Else
  rs_loaction.Requery
End If
%>
        </select></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Supplier:</div></th>
        <td class="WADADataTableCell">
          <select name="RM_Supplier">
            <%
While (NOT rs_Supplier.EOF)
%>
            <option value="<%=(rs_Supplier.Fields.Item("supplier_name").Value)%>"><%=(rs_Supplier.Fields.Item("supplier_name").Value)%></option>
            <%
  rs_Supplier.MoveNext()
Wend
If (rs_Supplier.CursorType > 0) Then
  rs_Supplier.MoveFirst
Else
  rs_Supplier.Requery
End If
%>
        </select></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Grade:</div></th>
        <td class="WADADataTableCell">
          <select name="RM_Grade">
            <%
While (NOT rs_Grades.EOF)
%>
            <option value="<%=(rs_Grades.Fields.Item("grade").Value)%>"><%=(rs_Grades.Fields.Item("grade").Value)%></option>
            <%
  rs_Grades.MoveNext()
Wend
If (rs_Grades.CursorType > 0) Then
  rs_Grades.MoveFirst
Else
  rs_Grades.Requery
End If
%>
        </select></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Thickness:</div></th>
        <td class="WADADataTableCell">
          <select name="RM_Thickness">
            <%
While (NOT rs_Thickness.EOF)
%>
            <option value="<%=(rs_Thickness.Fields.Item("thickness").Value)%>"><%=(rs_Thickness.Fields.Item("thickness").Value)%></option>
            <%
  rs_Thickness.MoveNext()
Wend
If (rs_Thickness.CursorType > 0) Then
  rs_Thickness.MoveFirst
Else
  rs_Thickness.Requery
End If
%>
        </select></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Quantity:</div></th>
        <td class="WADADataTableCell">
          <select name="RM_Quantity">
            <%
While (NOT rs_Quantity.EOF)
%>
            <option value="<%=(rs_Quantity.Fields.Item("quantity_count").Value)%>"><%=(rs_Quantity.Fields.Item("quantity_count").Value)%></option>
            <%
  rs_Quantity.MoveNext()
Wend
If (rs_Quantity.CursorType > 0) Then
  rs_Quantity.MoveFirst
Else
  rs_Quantity.Requery
End If
%>
        </select></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left">Status:</div></th>
        <td class="WADADataTableCell">        <select name="RM_Status">
          <%
While (NOT rs_status.EOF)
%>
          <option value="<%=(rs_status.Fields.Item("status").Value)%>"><%=(rs_status.Fields.Item("status").Value)%></option>
          <%
  rs_status.MoveNext()
Wend
If (rs_status.CursorType > 0) Then
  rs_status.MoveFirst
Else
  rs_status.Requery
End If
%>
        </select></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" readonly name="RM_Product" id="RM_Product" value="<%=request.form("RMProduct")%>" size="20" /></td>
      </tr>
    </table>
    <div class="WADAButtonRow">
      <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td class="WADADataNavButtonCell" nowrap="nowrap"><input name="Insert" type="image" id="Insert" value="Insert" src="WA_DataAssist/images/Pacifica/Modular_insert.gif" alt="Insert" width="56" height="17" hspace="0" vspace="0" border="0"  /></td>
          <td class="WADADataNavButtonCell" nowrap="nowrap"><a href="tbl_RM_Materials_Results.asp"><img src="WA_DataAssist/images/Pacifica/Modular_cancel.gif" alt="Cancel" name="Cancel" width="56" height="17" border="0" id="Cancel" /></a></td>
        </tr>
      </table>
      <input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="">
</div>
  </form>
  <p><strong><span class="style3">MAKE ALL SELECTIONS AS APPROPRIATE PRIOR TO SCANNING! </span>Once selections have been made place cursor in &quot;BCODE&quot; field. You may now scan barcode to submit unit to floor inventory.</strong></p>
  <p>  <table border="0">
    <tr>
      <td>  
	  	<form name="form0" method="post" action="http://pwccore/pacinet/veneermove/VeneerSearch.asp">
  <input type="submit" name="Submit" value="Veneer Search"></form>
	  <form name="form1" method="post" action="http://pwccore/rmapps/pdaform.asp">
    <input type="submit" name="Submit" value="Receiving Home">
  </form>
  <form name="form2" method="post" action="http://pwccore/pacinet/veneermove/tbl_RM_Materials_Results.asp">
    <input type="submit" name="Submit" value="Floor Inventory">
  </form>
  <form name="form3" method="post" action="http://pwccore/pacinet/veneermove/tbl_RM_Materials_Insert_Scarf.asp">
    <input type="submit" name="Submit" value="Scarf Page">
  </form>
</td>
    </tr>
  </table>
&nbsp;</p>
</div>
</body>
</html>
<%
rs_loaction.Close()
Set rs_loaction = Nothing
%>
<%
rs_status.Close()
Set rs_status = Nothing
%>
<%
rs_Supplier.Close()
Set rs_Supplier = Nothing
%>
<%
rs_Grades.Close()
Set rs_Grades = Nothing
%>
<%
rs_Thickness.Close()
Set rs_Thickness = Nothing
%>
<%
rs_Quantity.Close()
Set rs_Quantity = Nothing
%>
[+][-]12.05.2007 at 01:26AM PST, ID: 20409927

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.05.2007 at 02:18AM PST, ID: 20410151

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.05.2007 at 02:21AM PST, ID: 20410159

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Controls, MS SQL Server, Macromedia Dreamweaver
Tags: Macromedia, Dreamweaver 8, ASP
Sign Up Now!
Solution Provided By: Rouchie
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628