Link to home
Start Free TrialLog in
Avatar of James Coats
James CoatsFlag for United States of America

asked on

ASP page form won't pass values to next ASP page form

I have these two pages. All pages work except for the last page which receives its values from the page prior to it.

When the form in the first pages tries to update the data values to the update pages it crashes on this line on the second page:

        <input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode((WADAdbotbl_RM_Materials.Fields.Item("RM_ID").Value))%>">


Database is using SQL server 2000
This page works. it gets values by searching a view and then rendering the values on this page:
 
_____________________________________________________________________________
 
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/veneermove.asp" -->
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%
If Session("dbotbl_RM_Materials_Results_QueryString") <> "" AND Request.ServerVariables("QUERY_STRING") = "" Then
Response.Redirect("tbl_RM_Materials_Results.asp?" & Session("dbotbl_RM_Materials_Results_QueryString"))
Else
Session("dbotbl_RM_Materials_Results_QueryString") = Request.QueryString
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_BCODE
WADAdbotbl_RM_Materials__ParamRM_BCODE = "-1"
If (cStr(Request("S_RM_BCODE")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_BCODE = cStr(Request("S_RM_BCODE"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_DateTime
WADAdbotbl_RM_Materials__ParamRM_DateTime = "1/1/1"
If (cStr(Request("S_RM_DateTime")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_DateTime = cStr(Request("S_RM_DateTime"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_PurchOrd
WADAdbotbl_RM_Materials__ParamRM_PurchOrd = "-1"
If (cStr(Request("S_RM_PurchOrd")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_PurchOrd = cStr(Request("S_RM_PurchOrd"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Location
WADAdbotbl_RM_Materials__ParamRM_Location = "-1"
If (cStr(Request("S_RM_Location")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Location = cStr(Request("S_RM_Location"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Supplier
WADAdbotbl_RM_Materials__ParamRM_Supplier = "-1"
If (cStr(Request("S_RM_Supplier")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Supplier = cStr(Request("S_RM_Supplier"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Grade
WADAdbotbl_RM_Materials__ParamRM_Grade = "-1"
If (cStr(Request("S_RM_Grade")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Grade = cStr(Request("S_RM_Grade"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Thickness
WADAdbotbl_RM_Materials__ParamRM_Thickness = "-1"
If (cStr(Request("S_RM_Thickness")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Thickness = cStr(Request("S_RM_Thickness"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Quantity
WADAdbotbl_RM_Materials__ParamRM_Quantity = "-1"
If (cStr(Request("S_RM_Quantity")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Quantity = cStr(Request("S_RM_Quantity"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Status
WADAdbotbl_RM_Materials__ParamRM_Status = "-1"
If (cStr(Request("S_RM_Status")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Status = cStr(Request("S_RM_Status"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials__ParamRM_Product
WADAdbotbl_RM_Materials__ParamRM_Product = "-1"
If (cStr(Request("S_RM_Product")) <> "") Then 
  WADAdbotbl_RM_Materials__ParamRM_Product = cStr(Request("S_RM_Product"))
End If
%>
<%
Dim WADAdbotbl_RM_Materials
Dim WADAdbotbl_RM_Materials_numRows
 
Set WADAdbotbl_RM_Materials = Server.CreateObject("ADODB.Recordset")
WADAdbotbl_RM_Materials.ActiveConnection = MM_veneermove_STRING
WADAdbotbl_RM_Materials.Source = "SELECT *  FROM dbo.RMaterial_RM_Materials  WHERE (RM_BCODE LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_BCODE, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_BCODE, "'", "''") + "') AND (RM_DateTime = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_DateTime, "'", "''") + "' OR '1/1/1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_DateTime, "'", "''") + "') AND (RM_PurchOrd LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_PurchOrd, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_PurchOrd, "'", "''") + "') AND (RM_Location LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Location, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Location, "'", "''") + "') AND (RM_Supplier LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Supplier, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Supplier, "'", "''") + "') AND (RM_Grade LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Grade, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Grade, "'", "''") + "') AND (RM_Thickness LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Thickness, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Thickness, "'", "''") + "') AND (RM_Quantity LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Quantity, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Quantity, "'", "''") + "') AND (RM_Status LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Status, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Status, "'", "''") + "') AND (RM_Product LIKE '%" + Replace(WADAdbotbl_RM_Materials__ParamRM_Product, "'", "''") + "%' OR '-1' = '" + Replace(WADAdbotbl_RM_Materials__ParamRM_Product, "'", "''") + "')  ORDER BY RM_DateTime DESC"
WADAdbotbl_RM_Materials.CursorType = 0
WADAdbotbl_RM_Materials.CursorLocation = 2
WADAdbotbl_RM_Materials.LockType = 1
WADAdbotbl_RM_Materials.Open()
 
WADAdbotbl_RM_Materials_numRows = 0
%>
<%
Dim WADAdbotbl_RM_Materials_1__numRows
Dim WADAdbotbl_RM_Materials_1__index
 
WADAdbotbl_RM_Materials_1__numRows = 1
WADAdbotbl_RM_Materials_1__index = 0
WADAdbotbl_RM_Materials_numRows = WADAdbotbl_RM_Materials_numRows + WADAdbotbl_RM_Materials_1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
Dim WADAdbotbl_RM_Materials_total
Dim WADAdbotbl_RM_Materials_first
Dim WADAdbotbl_RM_Materials_last
 
' set the record count
WADAdbotbl_RM_Materials_total = WADAdbotbl_RM_Materials.RecordCount
 
' set the number of rows displayed on this page
If (WADAdbotbl_RM_Materials_numRows < 0) Then
  WADAdbotbl_RM_Materials_numRows = WADAdbotbl_RM_Materials_total
Elseif (WADAdbotbl_RM_Materials_numRows = 0) Then
  WADAdbotbl_RM_Materials_numRows = 1
End If
 
' set the first and last displayed record
WADAdbotbl_RM_Materials_first = 1
WADAdbotbl_RM_Materials_last  = WADAdbotbl_RM_Materials_first + WADAdbotbl_RM_Materials_numRows - 1
 
' if we have the correct record count, check the other stats
If (WADAdbotbl_RM_Materials_total <> -1) Then
  If (WADAdbotbl_RM_Materials_first > WADAdbotbl_RM_Materials_total) Then
    WADAdbotbl_RM_Materials_first = WADAdbotbl_RM_Materials_total
  End If
  If (WADAdbotbl_RM_Materials_last > WADAdbotbl_RM_Materials_total) Then
    WADAdbotbl_RM_Materials_last = WADAdbotbl_RM_Materials_total
  End If
  If (WADAdbotbl_RM_Materials_numRows > WADAdbotbl_RM_Materials_total) Then
    WADAdbotbl_RM_Materials_numRows = WADAdbotbl_RM_Materials_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (WADAdbotbl_RM_Materials_total = -1) Then
 
  ' count the total records by iterating through the recordset
  WADAdbotbl_RM_Materials_total=0
  While (Not WADAdbotbl_RM_Materials.EOF)
    WADAdbotbl_RM_Materials_total = WADAdbotbl_RM_Materials_total + 1
    WADAdbotbl_RM_Materials.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (WADAdbotbl_RM_Materials.CursorType > 0) Then
    WADAdbotbl_RM_Materials.MoveFirst
  Else
    WADAdbotbl_RM_Materials.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (WADAdbotbl_RM_Materials_numRows < 0 Or WADAdbotbl_RM_Materials_numRows > WADAdbotbl_RM_Materials_total) Then
    WADAdbotbl_RM_Materials_numRows = WADAdbotbl_RM_Materials_total
  End If
 
  ' set the first and last displayed record
  WADAdbotbl_RM_Materials_first = 1
  WADAdbotbl_RM_Materials_last = WADAdbotbl_RM_Materials_first + WADAdbotbl_RM_Materials_numRows - 1
  
  If (WADAdbotbl_RM_Materials_first > WADAdbotbl_RM_Materials_total) Then
    WADAdbotbl_RM_Materials_first = WADAdbotbl_RM_Materials_total
  End If
  If (WADAdbotbl_RM_Materials_last > WADAdbotbl_RM_Materials_total) Then
    WADAdbotbl_RM_Materials_last = WADAdbotbl_RM_Materials_total
  End If
 
End If
%>
<%
Dim MM_paramName 
%>
<%
' *** Move To Record and Go To Record: declare variables
 
Dim MM_rs
Dim MM_rsCount
Dim MM_size
Dim MM_uniqueCol
Dim MM_offset
Dim MM_atTotal
Dim MM_paramIsDefined
 
Dim MM_param
Dim MM_index
 
Set MM_rs    = WADAdbotbl_RM_Materials
MM_rsCount   = WADAdbotbl_RM_Materials_total
MM_size      = WADAdbotbl_RM_Materials_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter
 
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
 
  ' use index parameter if defined, otherwise use offset parameter
  MM_param = Request.QueryString("index")
  If (MM_param = "") Then
    MM_param = Request.QueryString("offset")
  End If
  If (MM_param <> "") Then
    MM_offset = Int(MM_param)
  End If
 
  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If
 
  ' move the cursor to the selected record
  MM_index = 0
  While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
  If (MM_rs.EOF) Then 
    MM_offset = MM_index  ' set MM_offset to the last possible record
  End If
 
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
 
If (MM_rsCount = -1) Then
 
  ' walk to the end of the display range for this page
  MM_index = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
 
  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = MM_index
    If (MM_size < 0 Or MM_size > MM_rsCount) Then
      MM_size = MM_rsCount
    End If
  End If
 
  ' if we walked off the end, set the offset based on page size
  If (MM_rs.EOF And Not MM_paramIsDefined) Then
    If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
      If ((MM_rsCount Mod MM_size) > 0) Then
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If
 
  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If
 
  ' move the cursor to the selected record
  MM_index = 0
  While (Not MM_rs.EOF And MM_index < MM_offset)
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats
 
' set the first and last displayed record
WADAdbotbl_RM_Materials_first = MM_offset + 1
WADAdbotbl_RM_Materials_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (WADAdbotbl_RM_Materials_first > MM_rsCount) Then
    WADAdbotbl_RM_Materials_first = MM_rsCount
  End If
  If (WADAdbotbl_RM_Materials_last > MM_rsCount) Then
    WADAdbotbl_RM_Materials_last = MM_rsCount
  End If
End If
 
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
 
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
 
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
 
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
  MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
 
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
 
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
  End If
Next
 
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
  End If
Next
 
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then 
  MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "")  Then
  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
 
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links
 
Dim MM_keepMove
Dim MM_moveParam
Dim MM_moveFirst
Dim MM_moveLast
Dim MM_moveNext
Dim MM_movePrev
 
Dim MM_urlStr
Dim MM_paramList
Dim MM_paramIndex
Dim MM_nextParam
 
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
 
' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 1) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    MM_paramList = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For MM_paramIndex = 0 To UBound(MM_paramList)
      MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
      If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If
 
' set the strings for the move to links
If (MM_keepMove <> "") Then 
  MM_keepMove = Server.HTMLEncode(MM_keepMove) & "&"
End If
 
MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
 
MM_moveFirst = MM_urlStr & "0"
MM_moveLast  = MM_urlStr & "-1"
MM_moveNext  = MM_urlStr & CStr(MM_offset + MM_size)
If (MM_offset - MM_size < 0) Then
  MM_movePrev = MM_urlStr & "0"
Else
  MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
End If
%>
<%
'WA AltClass Iterator
class WA_AltClassIterator
  public ClassArray
  public ClassCounter
end class
 
function WA_AltClassIterator_getClass(loopObj, incrementClass) 
  if (UBound(loopObj.ClassArray) = 0) then
    WA_AltClassIterator_getClass = ""
    exit function
  end if
  if (incrementClass) then
    if (loopObj.ClassCounter > UBound(loopObj.ClassArray)) then
      loopObj.ClassCounter = 0
    end if
    loopObj.ClassCounter = loopObj.ClassCounter + 1
  end if
  if (loopObj.ClassCounter > 0) then
    WA_AltClassIterator_getClass = loopObj.ClassArray(loopObj.ClassCounter-1)
  else
    WA_AltClassIterator_getClass = loopObj.ClassArray(0)
  end if
end function
%>
<%
'WA Alternating Class
Dim WARRT_AltClass1
Set WARRT_AltClass1 = new WA_AltClassIterator
WARRT_AltClass1.ClassCounter = 0
WARRT_AltClass1.ClassArray = Split("WADAResultsRowDark|", "|")
%>
<!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>Results 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: #95CAFF;
}
.style1 {font-size: 14px}
a:link {
	color: #1E23F9;
}
a:visited {
	color: #D80FDC;
}
a:hover {
	color: #000000;
}
a:active {
	color: #FF0000;
}
-->
</style></head>
 
<body>
 
<body onload="document.forms['WADASearchForm'].S_RM_BCODE.focus();">
 
<div class="WADASearchContainer">
  <form action="tbl_RM_Materials_Results.asp" method="get" name="WADASearchForm" id="WADASearchForm">
    <div class="WADAHeader style1">SCAN BAR CODE TO RETREIVE FROM FLOOR INVENTORY</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="S_RM_BCODE" id="S_RM_BCODE" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_DateTime" id="S_RM_DateTime" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_PurchOrd" id="S_RM_PurchOrd" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Location" id="S_RM_Location" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Supplier" id="S_RM_Supplier" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Grade" id="S_RM_Grade" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Thickness" id="S_RM_Thickness" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Quantity" id="S_RM_Quantity" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Status" id="S_RM_Status" value="" size="20" /></td>
      </tr>
      <tr>
        <th class="WADADataTableHeader"><div align="left"></div></th>
        <td class="WADADataTableCell"><input type="hidden" name="S_RM_Product" id="S_RM_Product" value="" size="20" /></td>
      </tr>
    </table>
    <table width="620" border="0" align="right">
      <tr>
        <td>  <% If Not WADAdbotbl_RM_Materials.EOF Or Not WADAdbotbl_RM_Materials.BOF Then %>
  <div class="WADAResults">
    <div class="WADAResultsNavigation">
      <div class="WADAResultsCount">Records <%=(WADAdbotbl_RM_Materials_first)%> to <%=(WADAdbotbl_RM_Materials_last)%> of <%=(WADAdbotbl_RM_Materials_total)%></div>
      <div class="WADAResultsNavTop">
        <table border="0" cellpadding="0" cellspacing="0" class="WADAResultsNavTable">
          <tr valign="middle">
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If MM_offset <> 0 Then %><a href="<%=MM_moveFirst%>" ><img src="WA_DataAssist/images/Pacifica/Modular_firsttxt.gif" alt="First" name="First" width="56" height="17" border="0" id="First" /></a>
                  <% End If ' end MM_offset <> 0 %></td>
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If MM_offset <> 0 Then %><a href="<%=MM_movePrev%>" ><img src="WA_DataAssist/images/Pacifica/Modular_previoustxt.gif" alt="Previous" name="Previous" width="56" height="17" border="0" id="Previous" /></a>
                  <% End If ' end MM_offset <> 0 %></td>
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If Not MM_atTotal Then %><a href="<%=MM_moveNext%>" ><img src="WA_DataAssist/images/Pacifica/Modular_nexttxt.gif" alt="Next" name="Next" width="56" height="17" border="0" id="Next" /></a>
                  <% End If ' end Not MM_atTotal %></td>
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If Not MM_atTotal Then %><a href="<%=MM_moveLast%>" ><img src="WA_DataAssist/images/Pacifica/Modular_lasttxt.gif" alt="Last" name="Last" width="56" height="17" border="0" id="Last" /></a>
                  <% End If ' end Not MM_atTotal %></td>
          </tr>
        </table>
      </div>
      <div class="WADAResultsInsertButton">  </div>
    </div>
    <table class="WADAResultsTable" border="1" cellpadding="1" cellspacing="1">
      <% 
While ((WADAdbotbl_RM_Materials_1__numRows <> 0) AND (NOT WADAdbotbl_RM_Materials.EOF)) 
%>
      <tr class="<%=WA_AltClassIterator_getClass(WARRT_AltClass1,true)%>">
	  	<tr>
	    <th class="WADAResultsTableHeader">BCODE:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_BCODE").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Date Time:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_DateTime").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Purchase Order:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_PurchOrd").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Location:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Location").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Supplier:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Supplier").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Grade:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Grade").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Thickness:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Thickness").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Quantity:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Quantity").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Status:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Status").Value)%></td>
		</tr>
		<tr>
		<th class="WADAResultsTableHeader">Product:</th>
        <td class="WADAResultsTableCell"><%=(WADAdbotbl_RM_Materials.Fields.Item("RM_Product").Value)%></td>
		</tr>
		<th></th>
        <td class="WADAResultsEditButtons" nowrap="nowrap"><table class="WADAEditButton_Table">
            <tr>
              <td></td>
              <td><a href="tbl_RM_Materials_Update.asp"><img src="WA_DataAssist/images/Pacifica/Modular_update.gif" alt="Update" name="Update" width="56" height="17" border="0" id="Update" /></a></td>
              <td></td>
            </tr>
        </table></td>
      </tr>
      <% 
  WADAdbotbl_RM_Materials_1__index=WADAdbotbl_RM_Materials_1__index+1
  WADAdbotbl_RM_Materials_1__numRows=WADAdbotbl_RM_Materials_1__numRows-1
  WADAdbotbl_RM_Materials.MoveNext()
Wend
%>
    </table>
    <div class="WADAResultsNavigation">
      <div class="WADAResultsCount">Records <%=(WADAdbotbl_RM_Materials_first)%> to <%=(WADAdbotbl_RM_Materials_last)%> of <%=(WADAdbotbl_RM_Materials_total)%></div>
      <div class="WADAResultsNavBottom">
        <table border="0" cellpadding="0" cellspacing="0" class="WADAResultsNavTable">
          <tr valign="middle">
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If MM_offset <> 0 Then %><a href="<%=MM_moveFirst%>" ><img src="WA_DataAssist/images/Pacifica/Modular_firsttxt.gif" alt="First" name="First" width="56" height="17" border="0" id="First" /></a>
                  <% End If ' end MM_offset <> 0 %></td>
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If MM_offset <> 0 Then %><a href="<%=MM_movePrev%>" ><img src="WA_DataAssist/images/Pacifica/Modular_previoustxt.gif" alt="Previous" name="Previous" width="56" height="17" border="0" id="Previous" /></a>
                  <% End If ' end MM_offset <> 0 %></td>
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If Not MM_atTotal Then %><a href="<%=MM_moveNext%>" ><img src="WA_DataAssist/images/Pacifica/Modular_nexttxt.gif" alt="Next" name="Next" width="56" height="17" border="0" id="Next" /></a>
                  <% End If ' end Not MM_atTotal %></td>
            <td class="WADAResultsNavButtonCell" nowrap="nowrap"><% If Not MM_atTotal Then %><a href="<%=MM_moveLast%>" ><img src="WA_DataAssist/images/Pacifica/Modular_lasttxt.gif" alt="Last" name="Last" width="56" height="17" border="0" id="Last" /></a>
                  <% End If ' end Not MM_atTotal %></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
  <% End If ' end Not WADAdbotbl_RM_Materials.EOF Or NOT WADAdbotbl_RM_Materials.BOF %> <% If WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF Then %>
  <div class="WADANoResults">
    <div class="WADANoResultsMessage">No results for your search</div>
    <div> <a href="tbl_RM_Materials_Insert_Scarf.asp"><img border="0" name="Insert" id="Insert" alt="Insert" src="WA_DataAssist/images/Pacifica/Modular_insert.gif" /></a> </div>
  </div>
<% End If ' end WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF %> 
</td>
      </tr>
    </table>
    <div class="WADAButtonRow">
      <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td class="WADADataNavButtonCell" nowrap="nowrap"><input name="Search" type="image" id="Search" value="Search" src="WA_DataAssist/images/Pacifica/Modular_search.gif" alt="Search" width="56" height="17" hspace="0" vspace="0" border="0"  /></td>
        </tr>
      </table>
    </div>
  </form>
</div>
<div class="WADAResultsContainer">
  <div class="WADAResultsHeader">
    <div class="WADAHeaderText">
	
  
  <form name="form3" method="post" action="http://localhost/tbl_RM_Materials_Insert_Scarf.asp">
    <input type="submit" name="Submit" value="Raw Materials">
  </form>
  <p>PRESS UPDATE TO CHANGE LOCATION OR MAKE CORRECTIONS</p>
  <p><a href="FloorMov_Instruc.htm" class="WADAHeaderText">Page Instructions</a> </p>
    </div>
  </div>
</body>
</html>
<%
WADAdbotbl_RM_Materials.Close()
Set WADAdbotbl_RM_Materials = Nothing
%>
 
 
 
 
 
 
 
 
_____________________________________________________________________________
 
This page is supposed to recrive the values and allow them to be changed and updated but it crashes on line 213 which is the table ID field.
 
Can you make some suggestions on changes to make that will help? Here's the page code
 
 
 
 
 
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/veneermove.asp" -->
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%
Dim WADAdbotbl_RM_Materials
Dim WADAdbotbl_RM_Materials_numRows
 
Set WADAdbotbl_RM_Materials = Server.CreateObject("ADODB.Recordset")
WADAdbotbl_RM_Materials.ActiveConnection = MM_veneermove_STRING
WADAdbotbl_RM_Materials.Source = "SELECT RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"
WADAdbotbl_RM_Materials.CursorType = 0
WADAdbotbl_RM_Materials.CursorLocation = 2
WADAdbotbl_RM_Materials.LockType = 1
WADAdbotbl_RM_Materials.Open()
 
WADAdbotbl_RM_Materials_numRows = 0
%>
<%
Dim rs_Location
Dim rs_Location_numRows
 
Set rs_Location = Server.CreateObject("ADODB.Recordset")
rs_Location.ActiveConnection = MM_veneermove_STRING
rs_Location.Source = "SELECT LocationNum FROM dbo.tbl_location ORDER BY LocationNum ASC"
rs_Location.CursorType = 0
rs_Location.CursorLocation = 2
rs_Location.LockType = 1
rs_Location.Open()
 
rs_Location_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 status FROM dbo.tbl_status ORDER BY status_ID ASC"
rs_Status.CursorType = 0
rs_Status.CursorLocation = 2
rs_Status.LockType = 1
rs_Status.Open()
 
rs_Status_numRows = 0
%>
<%
' WA Application Builder Update
if (cStr(Request.Form("Update.x")) <> "")  then
  WA_connection = MM_veneermove_STRING
  WA_table = "dbo.tbl_RM_Materials"
  WA_redirectURL = "tbl_RM_Materials_Results.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, "|")
 
  WA_where_fieldValuesStr = "" & cStr(cStr(Request.Form("WADAUpdateRecordID"))) & ""
  WA_where_columnTypesStr = "none,none,NULL"
  WA_where_comparisonStr = "="
  WA_where_fieldNames = Split(WA_indexField,"|")
  WA_where_fieldValues = Split(WA_where_fieldValuesStr,"|")
  WA_where_columns = Split(WA_where_columnTypesStr,"|")
  WA_where_comparisions = Split(WA_where_comparisonStr, "|")
  
 
  updateParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
  WhereObj = WA_AB_generateWhereClause(WA_where_fieldNames, WA_where_columns, WA_where_fieldValues, WA_where_comparisions)
  
  set MM_editCmd = Server.CreateObject("ADODB.Command")
  MM_editCmd.ActiveConnection = WA_connection
  MM_editCmd.CommandText = "UPDATE " & WA_table & " SET " & updateParamsObj(3) & " WHERE " & WhereObj & ""
  MM_editCmd.Execute()
  MM_editCmd.ActiveConnection.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>Update tbl_RM_Materials</title>
<link href="WA_DataAssist/styles/Modular_Poppy.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: #FFE8E8;
}
.style1 {color: #FF0000}
.style2 {font-size: 16}
.style11 {color: #FF0000; font-size: 16px; }
.style14 {font-size: 18px}
-->
</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['WADAUpdateForm'].RM_Location.focus();">
<body>
 
<div id="Layer1" style="position:absolute; left:400px; top:200px; width:479px; height:56px; z-index:1"> 
  <p class="WADAHeaderText style14">To update the record choose new &quot;Location&quot; &amp; &quot;Status&quot;.</p>
  <p class="WADAHeaderText style2"><span class="style11"><span class="style14">To leave the record unchanged click &quot;Cancel&quot;</span>.</span> </p>
</div>
<div id="Layer2" style="position:absolute; left:308px; top:119px; width:171px; height:22px; z-index:2"><em><strong><span class="style1">RESET &quot;LOCATION!&quot;</span></strong></em></div>
<div id="Layer3" style="position:absolute; left:311px; top:288px; width:160px; height:25px; z-index:3" class="style1"><em><strong>RESET &quot;STATUS!&quot;</strong></em></div>
<div class="WADAUpdateContainer"> 
    <form action="tbl_RM_Materials_Update.asp" method="post" name="WADAUpdateForm" id="WADAUpdateForm">
      <div class="WADAHeader">Update Record: Select new location  and press update. </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="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_BCODE").Value)&"", """", "&quot;")%>" size="32" /></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="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"></th>
          <td class="WADADataTableCell"><input type="Hidden" readonly name="RM_PurchOrd" id="RM_PurchOrd" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_PurchOrd").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Location:</div></th>
          <td class="WADADataTableCell">
            <select name="RM_Location">
              <%
While (NOT rs_Location.EOF)
%>
              <option value="<%=(rs_Location.Fields.Item("LocationNum").Value)%>"><%=(rs_Location.Fields.Item("LocationNum").Value)%></option>
              <%
  rs_Location.MoveNext()
Wend
If (rs_Location.CursorType > 0) Then
  rs_Location.MoveFirst
Else
  rs_Location.Requery
End If
%>
          </select></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Supplier:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Supplier" id="RM_Supplier" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Supplier").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Grade:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Grade" id="RM_Grade" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Grade").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Thickness:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Thickness" id="RM_Thickness" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Thickness").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Quantity:</div></th>
          <td class="WADADataTableCell"><input type="text" name="RM_Quantity" id="RM_Quantity" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Quantity").Value)&"", """", "&quot;")%>" size="32" /></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="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Product").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
      </table>
      <div class="WADAButtonRow">
        <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="WADADataNavButtonCell" nowrap="nowrap"><input name="Update" type="image" id="Update" value="Update" src="WA_DataAssist/images/Poppy/Modular_update.gif" alt="Update" 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/Poppy/Modular_cancel.gif" alt="Cancel" name="Cancel" width="56" height="17" border="0" id="Cancel" /></a></td>
          </tr>
        </table>
        <input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode((WADAdbotbl_RM_Materials.Fields.Item("RM_ID").Value))%>">
      </div>
       <% If WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF Then %>
      <div class="WADANoResults">
        <div class="WADANoResultsMessage">No record found.</div>
      </div>
      <% End If ' end WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF %>
    </form>
	  <p>  <table border="0">
    <tr>
      <td>  
	  	
  <form name="form2" method="post" action="http://localhost/tbl_RM_Materials_Results.asp">
    <input type="submit" name="Submit" value="Floor Inventory">
  </form>
  <form name="form3" method="post" action="http://localhost/tbl_RM_Materials_Insert_Scarf.asp">
    <input type="submit" name="Submit" value="Raw Materials Page">
  </form>
</td>
    </tr>
  </table>
&nbsp;</p>
 
</div>
</body>
</html>
<%
WADAdbotbl_RM_Materials.Close()
Set WADAdbotbl_RM_Materials = Nothing
%>
<%
rs_Location.Close()
Set rs_Location = Nothing
%>
<%
rs_Status.Close()
Set rs_Status = Nothing
%>

Open in new window

Avatar of rg20
rg20
Flag of United States of America image

Your query on the page doesn't select RM_id.
Avatar of James Coats

ASKER

I don't need the field RM_id. The query is calling a "view" from SQL Server 2000 and I just checked this view and that field in not included in the SQL because it was not selected when building the view

I have included that "RM_ID" by writing it by hand in the code and I get a not found error which you would expect.

What do you suggest next??
Where would you expect that field to come from?  You are using it as if it was part of the recordset.

If it came from a previous page, then you would use request.form("rm_id")
I changed to page code as follows:
__________________________________________________________________________________-
  WA_fieldNamesStr = "RM_ID|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_ID"))) & """" & 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,''|',none,''|"
  WA_comparisonStr = " LIKE | = | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE | LIKE "

_______________________________________________________________________________

I am still getting an error on line 213

This is line 213


        <input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode((WADAdboRMaterial_RM_Materials.Fields.Item("RM_ID").Value))%>">
This line

WADAdbotbl_RM_Materials.Source = "SELECT RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"

does not contain RM_ID which is what your calling in the input box below


in this line 213
WADAdboRMaterial_RM_Materials is not defined
maybe WADAdbotbl_RM_Materials
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode((WADAdboRMaterial_RM_Materials.Fields.Item("RM_ID").Value))%>">

also just below that you have
<% If WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF Then %>
      <div class="WADANoResults">
        <div class="WADANoResultsMessage">No record found.</div>
      </div>
      <% End If ' end WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF %>

you are using the recordset before checking if BOF and EOF are true?

Try this

"SELECT RM_ID, RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"
 
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode((WADAdbotbl_RM_Materials.Fields.Item("RM_ID").Value))%>">

Open in new window

Just tried the example you gave. It seems an improvement. I got this error now:

_________________________________________________________________________


Technical Information (for support personnel)
"      Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'RM_ID'.
/tbl_RM_Materials_Update.asp, line 14
"      Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
"      Page:
GET /tbl_RM_Materials_Update.asp
"      Time:
Tuesday, July 14, 2009, 11:01:51 AM
"      More information:
Microsoft Support


___________________________________________________________________________


This is the page code from line 1 to line 17

_____________________________________________________________________________

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/veneermove.asp" -->
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%
Dim WADAdbotbl_RM_Materials
Dim WADAdbotbl_RM_Materials_numRows
Dim WADAdboRMaterial_RM_Materials
Set WADAdbotbl_RM_Materials = Server.CreateObject("ADODB.Recordset")
WADAdbotbl_RM_Materials.ActiveConnection = MM_veneermove_STRING
WADAdbotbl_RM_Materials.Source = "SELECT RM_ID, RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"
WADAdbotbl_RM_Materials.CursorType = 0
WADAdbotbl_RM_Materials.CursorLocation = 2
WADAdbotbl_RM_Materials.LockType = 1
WADAdbotbl_RM_Materials.Open()

WADAdbotbl_RM_Materials_numRows = 0
%>

__________________________________________________________________________


Line 14 doesn't make sense to me on this one, this is line 14:


WADAdbotbl_RM_Materials.Open()


I don't see where this is related to the error:

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'RM_ID'.
/tbl_RM_Materials_Update.asp, line 14

___________________________________________________________________________

This is the whole ASP page:



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/veneermove.asp" -->
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%
Dim WADAdbotbl_RM_Materials
Dim WADAdbotbl_RM_Materials_numRows
Dim WADAdboRMaterial_RM_Materials
Set WADAdbotbl_RM_Materials = Server.CreateObject("ADODB.Recordset")
WADAdbotbl_RM_Materials.ActiveConnection = MM_veneermove_STRING
WADAdbotbl_RM_Materials.Source = "SELECT RM_ID, RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"
WADAdbotbl_RM_Materials.CursorType = 0
WADAdbotbl_RM_Materials.CursorLocation = 2
WADAdbotbl_RM_Materials.LockType = 1
WADAdbotbl_RM_Materials.Open()

WADAdbotbl_RM_Materials_numRows = 0
%>
<%
Dim rs_Location
Dim rs_Location_numRows

Set rs_Location = Server.CreateObject("ADODB.Recordset")
rs_Location.ActiveConnection = MM_veneermove_STRING
rs_Location.Source = "SELECT LocationNum FROM dbo.tbl_location ORDER BY LocationNum ASC"
rs_Location.CursorType = 0
rs_Location.CursorLocation = 2
rs_Location.LockType = 1
rs_Location.Open()

rs_Location_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 status FROM dbo.tbl_status ORDER BY status_ID ASC"
rs_Status.CursorType = 0
rs_Status.CursorLocation = 2
rs_Status.LockType = 1
rs_Status.Open()

rs_Status_numRows = 0
%>
<%
' WA Application Builder Update
if (cStr(Request.Form("Update.x")) <> "")  then
  WA_connection = MM_veneermove_STRING
  WA_table = "dbo.RMaterial_RM_Materials"
  WA_redirectURL = "tbl_RM_Materials_Results.asp"
  WA_keepQueryString = false
  WA_indexField = "RM_ID"
  WA_fieldNamesStr = "RM_ID|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_ID"))) & """" & 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,''|',none,''|"
  WA_comparisonStr = " LIKE | = | 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, "|")

  WA_where_fieldValuesStr = "" & cStr(cStr(Request.Form("WADAUpdateRecordID"))) & ""
  WA_where_columnTypesStr = "none,none,NULL"
  WA_where_comparisonStr = "="
  WA_where_fieldNames = Split(WA_indexField,"|")
  WA_where_fieldValues = Split(WA_where_fieldValuesStr,"|")
  WA_where_columns = Split(WA_where_columnTypesStr,"|")
  WA_where_comparisions = Split(WA_where_comparisonStr, "|")
 

  updateParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
  WhereObj = WA_AB_generateWhereClause(WA_where_fieldNames, WA_where_columns, WA_where_fieldValues, WA_where_comparisions)
 
  set MM_editCmd = Server.CreateObject("ADODB.Command")
  MM_editCmd.ActiveConnection = WA_connection
  MM_editCmd.CommandText = "UPDATE " & WA_table & " SET " & updateParamsObj(3) & " WHERE " & WhereObj & ""
  MM_editCmd.Execute()
  MM_editCmd.ActiveConnection.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>Update tbl_RM_Materials</title>
<link href="WA_DataAssist/styles/Modular_Poppy.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: #FFE8E8;
}
.style1 {color: #FF0000}
.style2 {font-size: 16}
.style11 {color: #FF0000; font-size: 16px; }
.style14 {font-size: 18px}
-->
</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['WADAUpdateForm'].RM_Location.focus();">
<body>
 
<div id="Layer1" style="position:absolute; left:400px; top:200px; width:479px; height:56px; z-index:1">
  <p class="WADAHeaderText style14">To update the record choose new &quot;Location&quot; &amp; &quot;Status&quot;.</p>
  <p class="WADAHeaderText style2"><span class="style11"><span class="style14">To leave the record unchanged click &quot;Cancel&quot;</span>.</span> </p>
</div>
<div id="Layer2" style="position:absolute; left:308px; top:119px; width:171px; height:22px; z-index:2"><em><strong><span class="style1">RESET &quot;LOCATION!&quot;</span></strong></em></div>
<div id="Layer3" style="position:absolute; left:311px; top:288px; width:160px; height:25px; z-index:3" class="style1"><em><strong>RESET &quot;STATUS!&quot;</strong></em></div>
<div class="WADAUpdateContainer">
    <form action="tbl_RM_Materials_Update.asp" method="post" name="WADAUpdateForm" id="WADAUpdateForm">
      <div class="WADAHeader">Update Record: Select new location  and press update. </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="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_BCODE").Value)&"", """", "&quot;")%>" size="32" /></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="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"></th>
          <td class="WADADataTableCell"><input type="Hidden" readonly name="RM_PurchOrd" id="RM_PurchOrd" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_PurchOrd").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Location:</div></th>
          <td class="WADADataTableCell">
            <select name="RM_Location">
              <%
While (NOT rs_Location.EOF)
%>
              <option value="<%=(rs_Location.Fields.Item("LocationNum").Value)%>"><%=(rs_Location.Fields.Item("LocationNum").Value)%></option>
              <%
  rs_Location.MoveNext()
Wend
If (rs_Location.CursorType > 0) Then
  rs_Location.MoveFirst
Else
  rs_Location.Requery
End If
%>
          </select></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Supplier:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Supplier" id="RM_Supplier" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Supplier").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Grade:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Grade" id="RM_Grade" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Grade").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Thickness:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Thickness" id="RM_Thickness" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Thickness").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Quantity:</div></th>
          <td class="WADADataTableCell"><input type="text" name="RM_Quantity" id="RM_Quantity" value="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Quantity").Value)&"", """", "&quot;")%>" size="32" /></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="<%=Replace((WADAdbotbl_RM_Materials.Fields.Item("RM_Product").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
      </table>
      <div class="WADAButtonRow">
        <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="WADADataNavButtonCell" nowrap="nowrap"><input name="Update" type="image" id="Update" value="Update" src="WA_DataAssist/images/Poppy/Modular_update.gif" alt="Update" 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/Poppy/Modular_cancel.gif" alt="Cancel" name="Cancel" width="56" height="17" border="0" id="Cancel" /></a></td>
          </tr>
        </table>
        <input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode((WADAdbotbl_RM_Materials.Fields.Item("RM_ID").Value))%>">
 
</div>
       <% If WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF Then %>
      <div class="WADANoResults">
        <div class="WADANoResultsMessage">No record found.</div>
      </div>
      <% End If ' end WADAdbotbl_RM_Materials.EOF And WADAdbotbl_RM_Materials.BOF %>
    </form>
        <p>  <table border="0">
    <tr>
      <td>  
              
  <form name="form2" method="post" action="http://localhost/tbl_RM_Materials_Results.asp">
    <input type="submit" name="Submit" value="Floor Inventory">
  </form>
  <form name="form3" method="post" action="http://localhost/tbl_RM_Materials_Insert_Scarf.asp">
    <input type="submit" name="Submit" value="Raw Materials Page">
  </form>
</td>
    </tr>
  </table>
&nbsp;</p>

</div>
</body>
</html>
<%
WADAdbotbl_RM_Materials.Close()
Set WADAdbotbl_RM_Materials = Nothing
%>
<%
rs_Location.Close()
Set rs_Location = Nothing
%>
<%
rs_Status.Close()
Set rs_Status = Nothing
%>

The SQL is the error, it appears that RM_ID is not in that view.  I believe you said that, my point was where is that ID supposed to come from

Try this
"SELECT RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"
 
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode(request("RM_ID"))%>">

Open in new window

Now I get this error:

_______________________________________

Technical Information (for support personnel)
"      Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/tbl_RM_Materials_Update.asp, line 10, column 35
WADAdbotbl_RM_Materials.Source = ""SELECT RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd FROM dbo.RMaterial_RM_Materials"
----------------------------------^

______________________________

You are on the right trail. I am thinking I will have to change all the "dbo.tbl_RM_Materials" code to "dbo.RMaterial_RM_Materials" because of the view I am using. What do you think?

I have to cut to lunch now - no choice I have to go to my bank. I be back after 13:30 hrs.

Sam
ASKER CERTIFIED SOLUTION
Avatar of rg20
rg20
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
rg20,

Just tried the code. The next page now renders but it presents the wrong record. The field "BCODE"  is the number " 1 " and it should be " 226953". I am sure it is looking at the wrong table. All other fields contain the wrong data as well.

I just checked it is pulling the first record that has a barcode in the field. I changed the " 1 " to 12345 and it just pulled the next record that is now the first record in the table.

The view "dbo.RMaterial_RM_Materials" is looking at both tables (a) tbl_RM_Materials, (b) RMaterial and selecting the most recently updated record and presenting that record in the web page. The first page in this problem. That page should pass the data it now has to the second page in this problem which will allow it to be updated again and then sent to the database "tbl_RM_Materials" were it will stay.

I think I can see that there need to be some code changes from "dbo.tbl_RM_Materials" to "dbo.RMaterial_RM_Materials" so that this will work. Am I on the right track, if I am I don't know where to try it out. Any suggestions?

Sam
rg20,

I am off tomorrow will return Thursday @ 10:00 hrs PST
I have gone through the page and replaced the following: WADAdbotbl_RM_Materials with WADAdboRMaterial_RM_Materials the errors walked me through the page and I corrected as I went.

Now the error has returned to line 16 that I have replaced all of the above corrections which is what it was when I started this.

I have attached the page as it is now.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/veneermove.asp" -->
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%
Dim WADAdbotbl_RM_Materials
Dim WADAdboRMaterial_RM_Materials_numRows
Dim WADAdboRMaterial_RM_Materials
Set WADAdboRMaterial_RM_Materials = Server.CreateObject("ADODB.Recordset")
WADAdboRMaterial_RM_Materials.ActiveConnection = MM_veneermove_STRING
WADAdboRMaterial_RM_Materials.Source = "SELECT RM_BCODE, RM_Datetime, RM_Supplier, RM_Product, RM_Grade, RM_Thickness, RM_Quantity, RM_PurchOrd  FROM dbo.RMaterial_RM_Materials"
WADAdboRMaterial_RM_Materials.CursorType = 0
WADAdboRMaterial_RM_Materials.CursorLocation = 2
WADAdboRMaterial_RM_Materials.LockType = 1
WADAdboRMaterial_RM_Materials.Open()
 
WADAdboRMaterial_RM_Materials_numRows = 0
%>
<%
Dim rs_Location
Dim rs_Location_numRows
 
Set rs_Location = Server.CreateObject("ADODB.Recordset")
rs_Location.ActiveConnection = MM_veneermove_STRING
rs_Location.Source = "SELECT LocationNum FROM dbo.tbl_location ORDER BY LocationNum ASC"
rs_Location.CursorType = 0
rs_Location.CursorLocation = 2
rs_Location.LockType = 1
rs_Location.Open()
 
rs_Location_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 status FROM dbo.tbl_status ORDER BY status_ID ASC"
rs_Status.CursorType = 0
rs_Status.CursorLocation = 2
rs_Status.LockType = 1
rs_Status.Open()
 
rs_Status_numRows = 0
%>
<%
' WA Application Builder Update
if (cStr(Request.Form("Update.x")) <> "")  then
  WA_connection = MM_veneermove_STRING
  WA_table = "dbo.RMaterial_RM_Materials"
  WA_redirectURL = "tbl_RM_Materials_Results.asp"
  WA_keepQueryString = false
  WA_indexField = "RM_ID"
  WA_fieldNamesStr = "RM_ID|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_ID"))) & """" & 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,''|',none,''|"
  WA_comparisonStr = " LIKE | = | 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, "|")
 
  WA_where_fieldValuesStr = "" & cStr(cStr(Request.Form("WADAUpdateRecordID"))) & ""
  WA_where_columnTypesStr = "none,none,NULL"
  WA_where_comparisonStr = "="
  WA_where_fieldNames = Split(WA_indexField,"|")
  WA_where_fieldValues = Split(WA_where_fieldValuesStr,"|")
  WA_where_columns = Split(WA_where_columnTypesStr,"|")
  WA_where_comparisions = Split(WA_where_comparisonStr, "|")
  
 
  updateParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
  WhereObj = WA_AB_generateWhereClause(WA_where_fieldNames, WA_where_columns, WA_where_fieldValues, WA_where_comparisions)
  
  set MM_editCmd = Server.CreateObject("ADODB.Command")
  MM_editCmd.ActiveConnection = WA_connection
  MM_editCmd.CommandText = "UPDATE " & WA_table & " SET " & updateParamsObj(3) & " WHERE " & WhereObj & ""
  MM_editCmd.Execute()
  MM_editCmd.ActiveConnection.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>Update tbl_RM_Materials</title>
<link href="WA_DataAssist/styles/Modular_Poppy.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: #FFE8E8;
}
.style1 {color: #FF0000}
.style2 {font-size: 16}
.style11 {color: #FF0000; font-size: 16px; }
.style14 {font-size: 18px}
-->
</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['WADAUpdateForm'].RM_Location.focus();">
<body>
 
<div id="Layer1" style="position:absolute; left:400px; top:200px; width:479px; height:56px; z-index:1"> 
  <p class="WADAHeaderText style14">To update the record choose new &quot;Location&quot; &amp; &quot;Status&quot;.</p>
  <p class="WADAHeaderText style2"><span class="style11"><span class="style14">To leave the record unchanged click &quot;Cancel&quot;</span>.</span> </p>
</div>
<div id="Layer2" style="position:absolute; left:308px; top:119px; width:171px; height:22px; z-index:2"><em><strong><span class="style1">RESET &quot;LOCATION!&quot;</span></strong></em></div>
<div id="Layer3" style="position:absolute; left:311px; top:288px; width:160px; height:25px; z-index:3" class="style1"><em><strong>RESET &quot;STATUS!&quot;</strong></em></div>
<div class="WADAUpdateContainer"> 
    <form action="tbl_RM_Materials_Update.asp" method="post" name="WADAUpdateForm" id="WADAUpdateForm">
      <div class="WADAHeader">Update Record: Select new location  and press update. </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="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_BCODE").Value)&"", """", "&quot;")%>" size="32" /></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="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"></th>
          <td class="WADADataTableCell"><input type="Hidden" readonly name="RM_PurchOrd" id="RM_PurchOrd" value="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_PurchOrd").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Location:</div></th>
          <td class="WADADataTableCell">
            <select name="RM_Location">
              <%
While (NOT rs_Location.EOF)
%>
              <option value="<%=(rs_Location.Fields.Item("LocationNum").Value)%>"><%=(rs_Location.Fields.Item("LocationNum").Value)%></option>
              <%
  rs_Location.MoveNext()
Wend
If (rs_Location.CursorType > 0) Then
  rs_Location.MoveFirst
Else
  rs_Location.Requery
End If
%>
          </select></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Supplier:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Supplier" id="RM_Supplier" value="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_Supplier").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Grade:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Grade" id="RM_Grade" value="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_Grade").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Thickness:</div></th>
          <td class="WADADataTableCell"><input type="text" readonly name="RM_Thickness" id="RM_Thickness" value="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_Thickness").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
        <tr>
          <th class="WADADataTableHeader"><div align="left">Quantity:</div></th>
          <td class="WADADataTableCell"><input type="text" name="RM_Quantity" id="RM_Quantity" value="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_Quantity").Value)&"", """", "&quot;")%>" size="32" /></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="<%=Replace((WADAdboRMaterial_RM_Materials.Fields.Item("RM_Product").Value)&"", """", "&quot;")%>" size="32" /></td>
        </tr>
      </table>
      <div class="WADAButtonRow">
        <table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="WADADataNavButtonCell" nowrap="nowrap"><input name="Update" type="image" id="Update" value="Update" src="WA_DataAssist/images/Poppy/Modular_update.gif" alt="Update" 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/Poppy/Modular_cancel.gif" alt="Cancel" name="Cancel" width="56" height="17" border="0" id="Cancel" /></a></td>
          </tr>
        </table>
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<%=Server.URLEncode(request("RM_ID"))%>">
 
</div>
       <% If WADAdboRMaterial_RM_Materials.EOF And WADAdboRMaterial_RM_Materials.BOF Then %>
      <div class="WADANoResults">
        <div class="WADANoResultsMessage">No record found.</div>
      </div>
      <% End If ' end WADAdboRMaterial_RM_Materials.EOF And WADAdboRMaterial_RM_Materials.BOF %>
    </form>
	  <p>  <table border="0">
    <tr>
      <td>  
	  	
  <form name="form2" method="post" action="http://localhost/tbl_RM_Materials_Results.asp">
    <input type="submit" name="Submit" value="Floor Inventory">
  </form>
  <form name="form3" method="post" action="http://localhost/tbl_RM_Materials_Insert_Scarf.asp">
    <input type="submit" name="Submit" value="Raw Materials Page">
  </form>
</td>
    </tr>
  </table>
&nbsp;</p>
 
</div>
</body>
</html>
<%
WADAdboRMaterial_RM_Materials.Close()
Set WADAdboRMaterial_RM_Materials = Nothing
%>
<%
rs_Location.Close()
Set rs_Location = Nothing
%>
<%
rs_Status.Close()
Set rs_Status = Nothing
%>

Open in new window

rg20, you fixed the issue at this point. The correct record is showing but when I go to update the record the next page crashes but that is a new problem. Sorry I wasn't paying attention. Thanks for you help