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

asked on

ASP page needs form field with drop down from one record set to be assoicated with record from same record set

On this page "BilletScanDefects_new.asp" I want to the field "TagNumber"  to have the correct "DateScanned" selected when the "TagNumber" is selected and then submitted to the form below it.

Both of those fields come from the same table. The way it is now I get the most rescent "DateScanned" tied to whatever "TagNumber" is selected.

The

The page is below
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/LISADATACONNECT.asp" -->
<%
' *** Edit Operations: declare variables
 
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
 
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
 
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
 
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
 
' boolean to abort record edit
MM_abortEdit = false
 
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
 
If (CStr(Request("MM_insert")) = "form1") Then
 
  MM_editConnection = MM_LISADATACONNECT_STRING
  MM_editTable = "dbo.RipsawBilletUsage"
  MM_editRedirectUrl = "BilletScanDefectsRipsaw_1_test.asp"
  MM_fieldsStr  = "TagNumber|value|RipDefectTimeDate|value|OperatrName|value|Grade|value|Thickness|value|Length|value|Pieces|value|Shift|value|RipWidth|value|RipWidth2|value|Delam|value|M_Blow|value|U_Blow|value|RoughEdge|value|Slip|value|Other|value"
  MM_columnsStr = "TagNumber|',none,''|RipDefectTimeDate|',none,''|OperatorName|',none,''|Grade|',none,''|Thickness|',none,''|Length|',none,''|Pieces|',none,''|Shift|',none,''|RipWidth|',none,''|RipWidth2|',none,''|Delam|',none,''|M_Blow|',none,''|U_Blow|',none,''|RoughEdge|',none,''|Slip|',none,''|Other|',none,''"
 
  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next
 
  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If
 
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
 
Dim MM_tableValues
Dim MM_dbValues
 
If (CStr(Request("MM_insert")) <> "") Then
Session("OpName") = trim(request.Form("OperatrName"))
 
 
  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
 
  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If
 
End If
%>
<%
' *** Edit Operations: declare variables
 
 
 
 
' in your code below, you are using a wildcard:  SELECT *
' this is not good practice, you should spell out all the fields that are going to be used in your code.
' Never use the Wildcard unless it is specifically called for, and you have to use it due to a coding issue.
Dim Recordset1
Dim Recordset1_numRows
 
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_LISADATACONNECT_STRING
Recordset1.Source = "SELECT *  FROM dbo.BilletScanX  ORDER BY BilletID DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
 
Recordset1_numRows = 0
%>
<%
Dim rs_RipsawBilletUsage
Dim rs_RipsawBilletUsage_cmd
Dim rs_RipsawBilletUsage_numRows
 
Set rs_RipsawBilletUsage_cmd = Server.CreateObject ("ADODB.Command")
rs_RipsawBilletUsage_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_RipsawBilletUsage_cmd.CommandText = "SELECT * FROM dbo.RipsawBilletUsage ORDER BY RipDefectTimeDate DESC" 
rs_RipsawBilletUsage_cmd.Prepared = true
 
Set rs_RipsawBilletUsage = rs_RipsawBilletUsage_cmd.Execute
rs_RipsawBilletUsage_numRows = 0
%>
<%
Dim rs_BilletScanX
Dim rs_BilletScanX_cmd
Dim rs_BilletScanX_numRows
 
Set rs_BilletScanX_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletScanX_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletScanX_cmd.CommandText = " SELECT Top 50 * FROM dbo.BilletScanX WHERE     (ScanTo LIKE 'RIPAUTO') ORDER BY BilletID DESC" 
rs_BilletScanX_cmd.Prepared = true
 
Set rs_BilletScanX = rs_BilletScanX_cmd.Execute
rs_BilletScanX_numRows = 0
%>
<%
Dim rs_BilletInvRipsawBilletUsageView
Dim rs_BilletInvRipsawBilletUsageView_cmd
Dim rs_BilletInvRipsawBilletUsageView_numRows
 
Set rs_BilletInvRipsawBilletUsageView_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletInvRipsawBilletUsageView_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletInvRipsawBilletUsageView_cmd.CommandText = "SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM dbo.Billet_InventoryANDRipsawBilletUsage" 
rs_BilletInvRipsawBilletUsageView_cmd.Prepared = true
 
Set rs_BilletInvRipsawBilletUsageView = rs_BilletInvRipsawBilletUsageView_cmd.Execute
rs_BilletInvRipsawBilletUsageView_numRows = 0
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
 
Repeat2__numRows = 10
Repeat2__index = 0
rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
Dim rs_RipsawBilletUsage_total
Dim rs_RipsawBilletUsage_first
Dim rs_RipsawBilletUsage_last
 
' set the record count
rs_RipsawBilletUsage_total = rs_RipsawBilletUsage.RecordCount
 
' set the number of rows displayed on this page
If (rs_RipsawBilletUsage_numRows < 0) Then
  rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
Elseif (rs_RipsawBilletUsage_numRows = 0) Then
  rs_RipsawBilletUsage_numRows = 1
End If
 
' set the first and last displayed record
rs_RipsawBilletUsage_first = 1
rs_RipsawBilletUsage_last  = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
 
' if we have the correct record count, check the other stats
If (rs_RipsawBilletUsage_total <> -1) Then
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (rs_RipsawBilletUsage_total = -1) Then
 
  ' count the total records by iterating through the recordset
  rs_RipsawBilletUsage_total=0
  While (Not rs_RipsawBilletUsage.EOF)
    rs_RipsawBilletUsage_total = rs_RipsawBilletUsage_total + 1
    rs_RipsawBilletUsage.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (rs_RipsawBilletUsage.CursorType > 0) Then
    rs_RipsawBilletUsage.MoveFirst
  Else
    rs_RipsawBilletUsage.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (rs_RipsawBilletUsage_numRows < 0 Or rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
 
  ' set the first and last displayed record
  rs_RipsawBilletUsage_first = 1
  rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
  
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_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    = rs_RipsawBilletUsage
MM_rsCount   = rs_RipsawBilletUsage_total
MM_size      = rs_RipsawBilletUsage_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
rs_RipsawBilletUsage_first = MM_offset + 1
rs_RipsawBilletUsage_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (rs_RipsawBilletUsage_first > MM_rsCount) Then
    rs_RipsawBilletUsage_first = MM_rsCount
  End If
  If (rs_RipsawBilletUsage_last > MM_rsCount) Then
    rs_RipsawBilletUsage_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
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Billet Scan Defects</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	background-image: url(images/lightlogo60.gif);
}
.style5 {
	color: #FFFFFF;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
 
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body bgcolor="#FFFFCC">
<form name="form1" method="POST" action="<%=MM_editAction%>">
 
<table  border="2" cellpadding="2" cellspacing="0" bordercolor="#000000" background="images/lightlogo60.gif" id="BilletDefects">
  <tr bgcolor="#000000">
    <td><span class="style5">Tag Number </span></td>
    <td><span class="style5">Oper. Name</span></td>
	<td><span class="style5">Date Scanned</span></td>
	<td colspan="5" rowspan="2"><span class="style5"></span><span class="style5"></span><span class="style5"></span><span class="style5"></span>
	  <input type="hidden" name="Grade">
	  <input type="hidden" name="Thickness">
	  <input type="hidden" name="Length">
	  <input type="hidden" name="Pieces">	  
	  <input type="hidden" name="shift"></td>
    <td><span class="style5">Rip Width Inch</span></td>
	<td><span class="style5">Rip Width MM</span></td>
    <td><span class="style5">No. of Delams</span></td>
    <td><span class="style5">No.  of M-Blows</span></td>
    <td><span class="style5">No. of U-Blows</span></td>
    <td><span class="style5">  Rough Edges</span></td>
	<td><span class="style5">No. o f Slips</span></td>
    <td><span class="style5">Comments</span></td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
Recordset1.MoveNext
   Wend
 
%>
  <tr bgcolor="#FFFFFF">
    <td><select name="TagNumber"><option value="" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If ("" = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>></option>
      <%
While (NOT rs_BilletScanX.EOF)
%>
      <option value="<%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%>" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If (CStr(rs_BilletScanX.Fields.Item("TagNumber").Value) = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%></option>
      <%
  rs_BilletScanX.MoveNext()
Wend
If (rs_BilletScanX.CursorType > 0) Then
  rs_BilletScanX.MoveFirst
Else
  rs_BilletScanX.Requery
End If
%></select></td>
 
<%
OpName = trim(request.Form("OperatrName"))
%>
 
 
<td><input type="text" size="10" name="OperatrName" value="<%=Session("OpName")%>"></td>
	<td><input name="RipDefectTimeDate" type="text" value="<%=(rs_BilletScanX.Fields.Item("DateScanned").Value)%>" size="10"></td>
	<td><input type="text" size="10" name="RipWidth"></td>
	<td><input type="text" size="10" name="RipWidth2"></td>
    <td><input type="text" size="10" name="Delam"></td>
    <td><input type="text" size="10" name="M_Blow"></td>
    <td><input type="text" size="10" name="U_Blow"></td>
    <td><input type="text" size="10" name="RoughEdge"></td>
	<td><input type="text" size="10" name="Slip"></td>
    <td><input type="text" size="10" name="Other"></td>
  </tr>
</table>
  <input type="submit" name="Submit" value="Submit">
  <input type="hidden" name="MM_insert" value="form1">
</form> <p><strong>To Make corrections "Click" TagNumber below</strong></p>
<table border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr>
    <td align="left" width="11%"> TagNumber </td>
    <td align="left" width="11%"> OperatorName </td>
	<td align="left" width="11%"> Date Scanned</td>
    <td align="left" width="11%"> RipWidth Inch</td>
	<td align="left" width="11%"> RipWidth MM </td>
    <td align="left" width="11%"> Delam </td>
    <td align="left" width="11%"> M_Blow </td>
    <td align="left" width="11%"> U_Blow </td>
    <td align="left" width="11%"> RoughEdge </td>
    <td align="left" width="11%"> Slip </td>
    <td align="left" width="11%">Comments</td>
  </tr>
  <% 
While ((Repeat2__numRows <> 0) AND (NOT rs_RipsawBilletUsage.EOF)) 
%>
    <tr>
      <td align="left" width="11%"><a href="cr4_1_test.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage.Fields.Item("RipDefectID").Value %>"><%=(rs_RipsawBilletUsage.Fields.Item("TagNumber").Value)%></a> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("OperatorName").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipDefectTimeDate").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth2").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Delam").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("M_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("U_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RoughEdge").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Slip").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Other").Value)%> </td>
    </tr>
    <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_RipsawBilletUsage.MoveNext()
Wend
%>
</table>
<br>
<table width="50%" border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr bgcolor="#CCCCCC">
    <td width="23%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_moveFirst%>">First</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="31%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_movePrev%>">Previous</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveNext%>">Next</a>
          <% End If ' end Not MM_atTotal %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveLast%>">Last</a>
          <% End If ' end Not MM_atTotal %>
    </td>
  </tr>
</table>
<strong>Records</strong> <%=(rs_RipsawBilletUsage_first)%> <strong>to</strong> <%=(rs_RipsawBilletUsage_last)%> <strong>of</strong> <%=(rs_RipsawBilletUsage_total)%>
 
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rs_RipsawBilletUsage.Close()
Set rs_RipsawBilletUsage = Nothing
%>
<%
rs_BilletScanX.Close()
Set rs_BilletScanX = Nothing
%>
<%
rs_BilletInvRipsawBilletUsageView.Close()
Set rs_BilletInvRipsawBilletUsageView = Nothing
%>

Open in new window

Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

In order to do what you are wanting to do you have 2 choices.
#1: When you choose the item from the dropdown, the page is refreshed and the values are read from the table, just like what you do when you choose the item to update it.

#2: AJAX, when you choose the tiem it will update it without refreshing the page.

That is your 2 options.
There is not another way of doing it.

Your choice.
Carrzkiss
Avatar of James Coats

ASKER

Which would you recommend? And what kind of SQL or asp would be involved? The TagNumber when selected just needs to retain the "DateScanned" associated with the TagNumber when it is sent to the new table. I don't think there is a problem with the page being refreshed and in fact this might be a good thing.
Let me do some checking.
If ONLY the DateScanned need to be associated with it.
I might be able to come up with something.

Give me a little while
Not a problem, we can put this off until Monday if you want as I had quite a day myself.
I got to thinking.
#1: How many [DateScanned] records do you have?
The reason why I ask is if you have a LOT then it is going to really do a wallop to get this data retreived in a
ListMenu / Select item and autoFill a Textfield.
As the Records would be read to the page behind the scenes.
So, lets say that you have 1,000 records, you would not want to load that to a page in an Array behind the scenes, as it is resource intensive, and can crash the browser or system doing so.

AJAX = Would be an option that you can venture into, and I will check on that over the weekend.
Try to make up a demo Access Database for me, with at least 25 records in it for the [TagNumber] and it associated [DataScanned]
This way I can work up a demo a lot easier for you.
We have tens of thousands of records. You can use the current records in the record sets you now have as those are the very records we will be using.

The tables are the ones we have been using all along: "RipsawBilletUsage" and "BilletScanX". The "DateScanned" field from "BilletScanX" needs to maintain its association with the field "TagNumber" from the same table when it is passed to the new table "RipsawBilletUsage"

Right now it tags the last "DateScanned" to all records passed to the table "RipsawBilletUsage".

I made some changes to the db you made earlier it has all the records we need


LISA-PACWOO.mdb
Hello Sam
Please have a look at this link https://www.experts-exchange.com/questions/24801116/ASP-form-to-database.html?anchorAnswerId=25540991#a25540991
I am sure that you will find the Demonstration that I have provided here to be very useful in teaching you nearly everything that you need to know to accomplish a lot of your goals.

(This is not related to this question, this is a simple Teaching Method only)

Enjoy Sam and have a great weekend
Carrzkiss
carrzkiss,

Thank you for the link. I will put it in my favorites.

Sam
carrzkiss,

We are having computer / server problems today so I will likely not be able to respond to anything you might do on this problem... just letting you know so you can better use your time.
carrzkiss,

Found a few minutes:

This page is currently in use: "BilletScanDefects4_Old.asp"

This page will replace it: "BilletScanDefects_new.asp"

Both pages submits to the same table in the same db. The second page has new fields in the table and new columns on the table have been added for it.

The page currently in use submits the correct "DateScanned" that is correctly related to the "TagNumber"

I thought that page might help you with fixing the second page. I have attached the page below.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/LISADATACONNECT.asp" -->
<%
' *** Edit Operations: declare variables
 
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
 
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
 
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
 
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
 
' boolean to abort record edit
MM_abortEdit = false
 
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
 
If (CStr(Request("MM_insert")) = "form1") Then
 
  MM_editConnection = MM_LISADATACONNECT_STRING
  MM_editTable = "dbo.RipsawBilletUsage"
  MM_editRedirectUrl = "BilletScanDefects4_Old.asp"
  MM_fieldsStr  = "TagNumber|value|OperatrName|value|Grade|value|Thickness|value|Length|value|Pieces|value|Shift|value|RipWidth|value|Delam|value|M_Blow|value|U_Blow|value|RoughEdge|value|Slip|value|Other|value"
  MM_columnsStr = "TagNumber|',none,''|OperatorName|',none,''|Grade|',none,''|Thickness|',none,''|Length|',none,''|Pieces|',none,''|Shift|',none,''|RipWidth|',none,''|Delam|',none,''|M_Blow|',none,''|U_Blow|',none,''|RoughEdge|',none,''|Slip|',none,''|Other|',none,''"
 
  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next
 
  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If
 
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
 
Dim MM_tableValues
Dim MM_dbValues
 
If (CStr(Request("MM_insert")) <> "") Then
Session("OpName") = trim(request.Form("OperatrName"))
 
 
  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
 
  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If
 
End If
%>
<%
' *** Edit Operations: declare variables
 
 
 
 
' in your code below, you are using a wildcard:  SELECT *
' this is not good practice, you should spell out all the fields that are going to be used in your code.
' Never use the Wildcard unless it is specifically called for, and you have to use it due to a coding issue.
Dim Recordset1
Dim Recordset1_numRows
 
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_LISADATACONNECT_STRING
Recordset1.Source = "SELECT *  FROM dbo.BilletScanX  ORDER BY BilletID DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
 
Recordset1_numRows = 0
%>
<%
Dim rs_RipsawBilletUsage
Dim rs_RipsawBilletUsage_numRows
 
Set rs_RipsawBilletUsage = Server.CreateObject("ADODB.Recordset")
rs_RipsawBilletUsage.ActiveConnection = MM_LISADATACONNECT_STRING
rs_RipsawBilletUsage.Source = "SELECT *  FROM dbo.RipsawBilletUsage ORDER BY RipDefectTimeDate DESC"
rs_RipsawBilletUsage.CursorType = 0
rs_RipsawBilletUsage.CursorLocation = 2
rs_RipsawBilletUsage.LockType = 1
rs_RipsawBilletUsage.Open()
 
rs_RipsawBilletUsage_numRows = 0
%>
<%
Dim rs_BilletScanX
Dim rs_BilletScanX_cmd
Dim rs_BilletScanX_numRows
 
Set rs_BilletScanX_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletScanX_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletScanX_cmd.CommandText = "SELECT Top 50 * FROM dbo.BilletScanX ORDER BY BilletID DESC" 
rs_BilletScanX_cmd.Prepared = true
 
Set rs_BilletScanX = rs_BilletScanX_cmd.Execute
rs_BilletScanX_numRows = 0
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
 
Repeat2__numRows = 10
Repeat2__index = 0
rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
Dim rs_RipsawBilletUsage_total
Dim rs_RipsawBilletUsage_first
Dim rs_RipsawBilletUsage_last
 
' set the record count
rs_RipsawBilletUsage_total = rs_RipsawBilletUsage.RecordCount
 
' set the number of rows displayed on this page
If (rs_RipsawBilletUsage_numRows < 0) Then
  rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
Elseif (rs_RipsawBilletUsage_numRows = 0) Then
  rs_RipsawBilletUsage_numRows = 1
End If
 
' set the first and last displayed record
rs_RipsawBilletUsage_first = 1
rs_RipsawBilletUsage_last  = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
 
' if we have the correct record count, check the other stats
If (rs_RipsawBilletUsage_total <> -1) Then
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (rs_RipsawBilletUsage_total = -1) Then
 
  ' count the total records by iterating through the recordset
  rs_RipsawBilletUsage_total=0
  While (Not rs_RipsawBilletUsage.EOF)
    rs_RipsawBilletUsage_total = rs_RipsawBilletUsage_total + 1
    rs_RipsawBilletUsage.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (rs_RipsawBilletUsage.CursorType > 0) Then
    rs_RipsawBilletUsage.MoveFirst
  Else
    rs_RipsawBilletUsage.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (rs_RipsawBilletUsage_numRows < 0 Or rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
 
  ' set the first and last displayed record
  rs_RipsawBilletUsage_first = 1
  rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
  
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_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    = rs_RipsawBilletUsage
MM_rsCount   = rs_RipsawBilletUsage_total
MM_size      = rs_RipsawBilletUsage_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
rs_RipsawBilletUsage_first = MM_offset + 1
rs_RipsawBilletUsage_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (rs_RipsawBilletUsage_first > MM_rsCount) Then
    rs_RipsawBilletUsage_first = MM_rsCount
  End If
  If (rs_RipsawBilletUsage_last > MM_rsCount) Then
    rs_RipsawBilletUsage_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
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Billet Scan Defects</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	background-image: url(images/lightlogo60.gif);
}
.style5 {
	color: #FFFFFF;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body bgcolor="#FFFFCC">
<form name="form1" method="POST" action="<%=MM_editAction%>">
 
<table  border="2" cellpadding="2" cellspacing="0" bordercolor="#000000" background="images/lightlogo60.gif" id="BilletDefects">
  <tr bgcolor="#000000">
    <td><span class="style5">Tag Number </span></td>
    <td><span class="style5">Oper. Name</span></td>
	<td colspan="5" rowspan="2"><span class="style5"></span><span class="style5"></span><span class="style5"></span><span class="style5"></span>
	  <input type="hidden" name="Grade">
	  <input type="hidden" name="Thickness">
	  <input type="hidden" name="Length">
	  <input type="hidden" name="Pieces">	  <input type="hidden" name="shift"></td>
    <td><span class="style5">Rip Widths</span></td>
    <td><span class="style5">No. of Delams</span></td>
    <td><span class="style5">No.  of M-Blows</span></td>
    <td><span class="style5">No. of U-Blows</span></td>
    <td><span class="style5">  Rough Edges</span></td>
	<td><span class="style5">No. o f Slips</span></td>
    <td><span class="style5">Comments</span></td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
Recordset1.MoveNext
   Wend
 
%>
  <tr bgcolor="#FFFFFF">
    <td><select name="TagNumber"><option value="" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If ("" = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>></option>
      <%
While (NOT rs_BilletScanX.EOF)
%>
      <option value="<%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%>" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If (CStr(rs_BilletScanX.Fields.Item("TagNumber").Value) = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%></option>
      <%
  rs_BilletScanX.MoveNext()
Wend
If (rs_BilletScanX.CursorType > 0) Then
  rs_BilletScanX.MoveFirst
Else
  rs_BilletScanX.Requery
End If
%></select></td>
 
<%
OpName = trim(request.Form("OperatrName"))
%>
 
 
<td><input type="text" size="10" name="OperatrName" value="<%=Session("OpName")%>"></td>
	<td><input type="text" size="10" name="RipWidth"></td>
    <td><input type="text" size="10" name="Delam"></td>
    <td><input type="text" size="10" name="M_Blow"></td>
    <td><input type="text" size="10" name="U_Blow"></td>
    <td><input type="text" size="10" name="RoughEdge"></td>
	<td><input type="text" size="10" name="Slip"></td>
    <td><input type="text" size="10" name="Other"></td>
  </tr>
</table>
  <input type="submit" name="Submit" value="Submit">
  <input type="hidden" name="MM_insert" value="form1">
</form> <p><strong>To Make corrections "Click" TagNumber below</strong></p>
<table border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr>
    <td align="left" width="11%"> TagNumber </td>
    <td align="left" width="11%"> OperatorName </td>
    <td align="left" width="11%"> RipWidth </td>
    <td align="left" width="11%"> Delam </td>
    <td align="left" width="11%"> M_Blow </td>
    <td align="left" width="11%"> U_Blow </td>
    <td align="left" width="11%"> RoughEdge </td>
    <td align="left" width="11%"> Slip </td>
    <td align="left" width="11%">Comments</td>
  </tr>
  <% 
While ((Repeat2__numRows <> 0) AND (NOT rs_RipsawBilletUsage.EOF)) 
%>
    <tr>
      <td align="left" width="11%"><a href="cr4.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage.Fields.Item("RipDefectID").Value %>"><%=(rs_RipsawBilletUsage.Fields.Item("TagNumber").Value)%></a> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("OperatorName").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Delam").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("M_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("U_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RoughEdge").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Slip").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Other").Value)%> </td>
    </tr>
    <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_RipsawBilletUsage.MoveNext()
Wend
%>
</table>
<br>
<table width="50%" border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr bgcolor="#CCCCCC">
    <td width="23%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_moveFirst%>">First</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="31%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_movePrev%>">Previous</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveNext%>">Next</a>
          <% End If ' end Not MM_atTotal %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveLast%>">Last</a>
          <% End If ' end Not MM_atTotal %>
    </td>
  </tr>
</table>
<strong>Records</strong> <%=(rs_RipsawBilletUsage_first)%> <strong>to</strong> <%=(rs_RipsawBilletUsage_last)%> <strong>of</strong> <%=(rs_RipsawBilletUsage_total)%>
 
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rs_RipsawBilletUsage.Close()
Set rs_RipsawBilletUsage = Nothing
%>
<%
rs_BilletScanX.Close()
Set rs_BilletScanX = Nothing
%>

Open in new window

Just got into work and can devote some time to this now.

Sam
OK Sam.
Just played around with it, and here you go
http://ee.cffcs.com/default-1.asp?EE=Post&Thread=Q_24798150&TID=111  (New Carrzkiss EE Site)
(Download link is on the page, as well as the demo, click on View  => Output <=)

Good Luck
Carrzkiss

Carrzkiss,

Ended up with other projects. I just looked at the page and I will try it out tomorrow. Thank you for the page and teaching me the coding. I am just too tired to do it right now. I will be in tomorrow @ 10:00hrs PST. I allready got the word to finish up on this project just a few minutes ago.

Talk to you then.

Sam
not a problem.
Carrzkiss
Just got into work. I tried the code and got this error. I am sure it is a matter of my putting the code into my new page wrong.

here's the error:

ADODB.Command error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/pacinet/BilletScanner/BilletScanDefects_new1.asp, line 136


I have attached the page as it is now.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/LISADATACONNECT.asp" -->
<!--#include file="dim.asp"-->
<%
 
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
 
' boolean to abort record edit
MM_abortEdit = false
 
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
 
If (CStr(Request("MM_insert")) = "form1") Then
 
  MM_editConnection = MM_LISADATACONNECT_STRING
  MM_editTable = "dbo.RipsawBilletUsage"
  MM_editRedirectUrl = "BilletScanDefectsRipsaw_1_test.asp"
  MM_fieldsStr  = "TagNumber|value|RipDefectTimeDate|value|OperatrName|value|Grade|value|Thickness|value|Length|value|Pieces|value|Shift|value|RipWidth|value|RipWidth2|value|Delam|value|M_Blow|value|U_Blow|value|RoughEdge|value|Slip|value|Other|value"
  MM_columnsStr = "TagNumber|',none,''|RipDefectTimeDate|',none,''|OperatorName|',none,''|Grade|',none,''|Thickness|',none,''|Length|',none,''|Pieces|',none,''|Shift|',none,''|RipWidth|',none,''|RipWidth2|',none,''|Delam|',none,''|M_Blow|',none,''|U_Blow|',none,''|RoughEdge|',none,''|Slip|',none,''|Other|',none,''"
 
  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next
 
  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If
 
End If
%>
<%
 
 
If (CStr(Request("MM_insert")) <> "") Then
Session("OpName") = trim(request.Form("OperatrName"))
 
 
  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
 
  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If
 
End If
%>
<%
' *** Edit Operations: declare variables
 
 
 
 
' in your code below, you are using a wildcard:  SELECT *
' this is not good practice, you should spell out all the fields that are going to be used in your code.
' Never use the Wildcard unless it is specifically called for, and you have to use it due to a coding issue.
 
 
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_LISADATACONNECT_STRING
Recordset1.Source = "SELECT *  FROM dbo.BilletScanX  ORDER BY BilletID DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
 
Recordset1_numRows = 0
%>
<%
 
 
Set rs_RipsawBilletUsage_cmd = Server.CreateObject ("ADODB.Command")
rs_RipsawBilletUsage_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_RipsawBilletUsage_cmd.CommandText = "SELECT * FROM dbo.RipsawBilletUsage ORDER BY RipDefectTimeDate DESC" 
rs_RipsawBilletUsage_cmd.Prepared = true
 
Set rs_RipsawBilletUsage = rs_RipsawBilletUsage_cmd.Execute
rs_RipsawBilletUsage_numRows = 0
%>
<%
Set getSQL = Server.CreateObject("ADODB.Command")
getSQL.ActiveConnection=objConn
getSQL.Prepared = true
getSQL.commandtext = "SELECT BilletID, TagNumber, ScanTo, DateScanned, TagGroup, TagShift FROM BilletScanX"
set objRs = getSQL.execute
set objRs1 = getSQL.execute
%>
<%
 
 
Set rs_BilletInvRipsawBilletUsageView_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletInvRipsawBilletUsageView_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletInvRipsawBilletUsageView_cmd.CommandText = "SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM dbo.Billet_InventoryANDRipsawBilletUsage" 
rs_BilletInvRipsawBilletUsageView_cmd.Prepared = true
 
Set rs_BilletInvRipsawBilletUsageView = rs_BilletInvRipsawBilletUsageView_cmd.Execute
rs_BilletInvRipsawBilletUsageView_numRows = 0
%>
<%
 
 
Repeat2__numRows = 10
Repeat2__index = 0
rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
 
' set the record count
rs_RipsawBilletUsage_total = rs_RipsawBilletUsage.RecordCount
 
' set the number of rows displayed on this page
If (rs_RipsawBilletUsage_numRows < 0) Then
  rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
Elseif (rs_RipsawBilletUsage_numRows = 0) Then
  rs_RipsawBilletUsage_numRows = 1
End If
 
' set the first and last displayed record
rs_RipsawBilletUsage_first = 1
rs_RipsawBilletUsage_last  = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
 
' if we have the correct record count, check the other stats
If (rs_RipsawBilletUsage_total <> -1) Then
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (rs_RipsawBilletUsage_total = -1) Then
 
  ' count the total records by iterating through the recordset
  rs_RipsawBilletUsage_total=0
  While (Not rs_RipsawBilletUsage.EOF)
    rs_RipsawBilletUsage_total = rs_RipsawBilletUsage_total + 1
    rs_RipsawBilletUsage.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (rs_RipsawBilletUsage.CursorType > 0) Then
    rs_RipsawBilletUsage.MoveFirst
  Else
    rs_RipsawBilletUsage.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (rs_RipsawBilletUsage_numRows < 0 Or rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
 
  ' set the first and last displayed record
  rs_RipsawBilletUsage_first = 1
  rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
  
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
 
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
 
 
Set MM_rs    = rs_RipsawBilletUsage
MM_rsCount   = rs_RipsawBilletUsage_total
MM_size      = rs_RipsawBilletUsage_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
rs_RipsawBilletUsage_first = MM_offset + 1
rs_RipsawBilletUsage_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (rs_RipsawBilletUsage_first > MM_rsCount) Then
    rs_RipsawBilletUsage_first = MM_rsCount
  End If
  If (rs_RipsawBilletUsage_last > MM_rsCount) Then
    rs_RipsawBilletUsage_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
 
 
' 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
 
 
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
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Billet Scan Defects</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	background-image: url(images/lightlogo60.gif);
}
.style5 {
	color: #FFFFFF;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
<script type="text/javascript"> 
if(window.addEventListener){ 
window.addEventListener('load',switchme,false); 
} 
else { 
if(window.attachEvent){ 
window.attachEvent('onload',switchme); 
} 
} 
 
function switchme(){ 
 
df=document.forms[0]; 
 
df[0].onchange=function(){ 
 
switch(this.value) { 
<%
While (NOT objRs.EOF)
'the df[2] line:35 & 42   this is the form Element Number, For the Fieldname: RipDefectTimeDate   DO NOT CHANGE%>
case '<%=objRs("BilletID")%>': 
df[2].value='<%=objRs("DateScanned")%>'; 
break; 
 
<%objRs.movenext
wend%>
 
default: 
df[2].value=''; 
break; 
} 
} 
} 
</script> 
</head>
<body>
<form name="form1" method="POST" action="<%=MM_editAction%>">
 
<table  border="2" cellpadding="2" cellspacing="0" bordercolor="#000000" background="images/lightlogo60.gif" id="BilletDefects">
  <tr bgcolor="#000000">
    <td><span class="style5">Tag Number </span></td>
    <td><span class="style5">Oper. Name</span></td>
	<td><span class="style5">Date Scanned</span></td>
    <td><span class="style5">Rip Width Inch</span></td>
	<td><span class="style5">Rip Width MM</span></td>
    <td><span class="style5">No. of Delams</span></td>
    <td><span class="style5">No.  of M-Blows</span></td>
    <td><span class="style5">No. of U-Blows</span></td>
    <td><span class="style5">  Rough Edges</span></td>
	<td><span class="style5">No. o f Slips</span></td>
    <td><span class="style5">Comments</span></td>
    <td>&nbsp;</td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT objRs1.EOF))
objRs1.MoveNext
   Wend
 
%>
  <tr bgcolor="#FFFFFF">
    <td><select name="TagNumber">
<option value="Choose One" selected="selected">Choose One</option>  
<%While NOT objRs1.EOF%>
<option value="<%=objRs1("BilletID")%>"><%=objRs1("TagNumber")%></option> 
<%objRs1.movenext
wend%>
</select> </td>
 
<%
OpName = trim(request.Form("OperatrName"))
%>
<div id="ExtraInfos">Select search option</div> 
 
<td><input type="text" size="10" name="OperatrName" value="<%=Session("OpName")%>"></td>
	<td><input name="RipDefectTimeDate" type="text" size="10"></td>
	<td><input type="text" size="10" name="RipWidth"></td>
	<td><input type="text" size="10" name="RipWidth2"></td>
    <td><input type="text" size="10" name="Delam"></td>
    <td><input type="text" size="10" name="M_Blow"></td>
    <td><input type="text" size="10" name="U_Blow"></td>
    <td><input type="text" size="10" name="RoughEdge"></td>
	<td><input type="text" size="10" name="Slip"></td>
    <td><input type="text" size="10" name="Other"></td>
    <%'I had to move these hidden form elements over here, as they were messing up my Form Count    DO NOT MOVE!!!!!%>
    <td colspan="5" rowspan="2"><span class="style5"></span><span class="style5"></span><span class="style5"></span><span class="style5"></span>
	  <input type="hidden" name="Grade">
	  <input type="hidden" name="Thickness">
	  <input type="hidden" name="Length">
	  <input type="hidden" name="Pieces">	  
	  <input type="hidden" name="shift"></td>
      <%'End of moved 'hidden' form elements  DO NOT MOVE!!!!!!!!!!%>
  </tr>
</table>
  <input type="submit" name="Submit" value="Submit">
  <input type="hidden" name="MM_insert" value="form1">
</form>
</body>
</html> <p><strong>To Make corrections "Click" TagNumber below</strong></p>
<table border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr>
    <td align="left" width="11%"> TagNumber </td>
    <td align="left" width="11%"> OperatorName </td>
	<td align="left" width="11%"> Date Scanned</td>
    <td align="left" width="11%"> RipWidth Inch</td>
	<td align="left" width="11%"> RipWidth MM </td>
    <td align="left" width="11%"> Delam </td>
    <td align="left" width="11%"> M_Blow </td>
    <td align="left" width="11%"> U_Blow </td>
    <td align="left" width="11%"> RoughEdge </td>
    <td align="left" width="11%"> Slip </td>
    <td align="left" width="11%">Comments</td>
  </tr>
  <% 
While ((Repeat2__numRows <> 0) AND (NOT rs_RipsawBilletUsage.EOF)) 
%>
    <tr>
      <td align="left" width="11%"><a href="cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage.Fields.Item("RipDefectID").Value %>"><%=(rs_RipsawBilletUsage.Fields.Item("TagNumber").Value)%></a> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("OperatorName").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipDefectTimeDate").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth2").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Delam").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("M_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("U_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RoughEdge").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Slip").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Other").Value)%> </td>
    </tr>
    <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_RipsawBilletUsage.MoveNext()
Wend
%>
</table>
<br>
<table width="50%" border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr bgcolor="#CCCCCC">
    <td width="23%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_moveFirst%>">First</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="31%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_movePrev%>">Previous</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveNext%>">Next</a>
          <% End If ' end Not MM_atTotal %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveLast%>">Last</a>
          <% End If ' end Not MM_atTotal %>
    </td>
  </tr>
</table>
<strong>Records</strong> <%=(rs_RipsawBilletUsage_first)%> <strong>to</strong> <%=(rs_RipsawBilletUsage_last)%> <strong>of</strong> <%=(rs_RipsawBilletUsage_total)%>
 
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rs_RipsawBilletUsage.Close()
Set rs_RipsawBilletUsage = Nothing
%>
<%
rs_BilletScanX.Close()
Set rs_BilletScanX = Nothing
%>
<%
rs_BilletInvRipsawBilletUsageView.Close()
Set rs_BilletInvRipsawBilletUsageView = Nothing
%>
</body>
</html>

Open in new window

Sam.
The code that I provided for you is ONLY for the select and display of the record that you asked for.
I did not go through all of your code, as you have a lot of DW generated code envolved.

What happened to the code that I made up for you?
You explain that to me, and I will go back and add it to what I made up for you before.
But I refuse to add it to this code, as it is DW mixed with Hand coded, which in return
Gives you a page of a lot of mess.
Line: 136    getSQL.ActiveConnection=objConn
Change it to
getSQL.ActiveConnection=MM_LISADATACONNECT_STRING
carrzkiss,

fair enough I will get on it.
Prior to getting your first code I made some changes by adding some fields that were requested which is why you have this page.

Just in case you are interested changing line 136 gave this error which I have never seen before:

Response object error 'ASP 0251 : 80004005'

Response Buffer Limit Exceeded

/pacinet/BilletScanner/BilletScanDefects_new1.asp, line 0

Execution of the ASP page caused the Response Buffer to exceed its configured limit.


I am now looking for the last non-dw page and will paste in your last code for the "TagNumber" & "DateScanned" problem. I will post shortly
What happened to all the code that I did for you?
What happened to the paging system that I marked up for you?

I wrote your entire site up, every bit of it was hand written for you
Something that I did that should have paid me about $500.00, I did for you free
To teach you how to do this correctly and properly.
And you are not using it.

I feel like I am wasting my time here Sam, what in the world is going on?
Like most of the American's, I am 1 of the unemployed one, trying to make a living do
This Web Development stuff, and I have done so much for you here on EE, but yet I am not
Seeing nothing that I have shown you in your code, except a few lines of it.

I am at a loss here.
Very upsetting, to know that I have spent all this time trying to teach you how to do this
And the only thing I get is a few points here and there.
This is not worth it, If you was paying me, I bet you would be using the code that I made up for you.
carrzkiss,

I understand. The page above is the last page you worked on fixing the pop up correction page. This is the question on which you made the "dim.asp" page which you said was due to the dw code.  I have all the code you have given me.

I won't get much time to study it until I get this page done. The other similar projects are quite a ways off so I can go back and take a long look at this.

Also I think I have got some pages mixed up I am working on that now.

carrzkiss,

I now have the page that you last made up that had the working "Popup" correction page. I will look at the new code you made and start working on incorporating it into this working page. I will add the last working page that you assisted me on to this post.

I am going to teach you something as well. I had decided to do this because you have been so much help to me. I have a Google adsense account and have made in the past very good money. In the +40K range per year.

Google changed their ranking system and now the site only makes $150 to $250 a month. Thing is I know you can make money with what you do. I will tell you all that I know and it will cost you nothing but the time to read my emails.

I will go back and check your links to see if I can contact you on one of your web sites or you can provide a link here for me.

I don't blame you for getting upset with me it's just that we have laid so many people off and thus we have more to do. Who know's I may be the next unemployed.

Any way here is the last page in which you fixed the "pop up" correction page. While you look at that I will work on putting your code into it and try to get it working.

I just have to fix the "TagNumber" and "DateScanned" thing and add one more field that I need to sort on and this will be done.

I then plan to go back and fix the entire thing by taking out all the dw code. And I will have the time to do it because the new projects are several weeks away.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/LISADATACONNECT.asp" -->
<!--#include file="dim.asp"-->
<%
 
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
 
' boolean to abort record edit
MM_abortEdit = false
 
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
 
If (CStr(Request("MM_insert")) = "form1") Then
 
  MM_editConnection = MM_LISADATACONNECT_STRING
  MM_editTable = "dbo.RipsawBilletUsage"
  MM_editRedirectUrl = "BilletScanDefectsRipsaw_1_test.asp"
  MM_fieldsStr  = "TagNumber|value|RipDefectTimeDate|value|OperatrName|value|Grade|value|Thickness|value|Length|value|Pieces|value|Shift|value|RipWidth|value|RipWidth2|value|Delam|value|M_Blow|value|U_Blow|value|RoughEdge|value|Slip|value|Other|value"
  MM_columnsStr = "TagNumber|',none,''|RipDefectTimeDate|',none,''|OperatorName|',none,''|Grade|',none,''|Thickness|',none,''|Length|',none,''|Pieces|',none,''|Shift|',none,''|RipWidth|',none,''|RipWidth2|',none,''|Delam|',none,''|M_Blow|',none,''|U_Blow|',none,''|RoughEdge|',none,''|Slip|',none,''|Other|',none,''"
 
  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next
 
  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If
 
End If
%>
<%
 
 
If (CStr(Request("MM_insert")) <> "") Then
Session("OpName") = trim(request.Form("OperatrName"))
 
 
  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
 
  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If
 
End If
%>
<%
' *** Edit Operations: declare variables
 
 
 
 
' in your code below, you are using a wildcard:  SELECT *
' this is not good practice, you should spell out all the fields that are going to be used in your code.
' Never use the Wildcard unless it is specifically called for, and you have to use it due to a coding issue.
 
 
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_LISADATACONNECT_STRING
Recordset1.Source = "SELECT *  FROM dbo.BilletScanX  ORDER BY BilletID DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
 
Recordset1_numRows = 0
%>
<%
 
 
Set rs_RipsawBilletUsage_cmd = Server.CreateObject ("ADODB.Command")
rs_RipsawBilletUsage_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_RipsawBilletUsage_cmd.CommandText = "SELECT * FROM dbo.RipsawBilletUsage ORDER BY RipDefectTimeDate DESC" 
rs_RipsawBilletUsage_cmd.Prepared = true
 
Set rs_RipsawBilletUsage = rs_RipsawBilletUsage_cmd.Execute
rs_RipsawBilletUsage_numRows = 0
%>
<%
 
 
Set rs_BilletScanX_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletScanX_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletScanX_cmd.CommandText = " SELECT Top 50 * FROM dbo.BilletScanX WHERE     (ScanTo LIKE 'RIPAUTO') ORDER BY BilletID DESC" 
rs_BilletScanX_cmd.Prepared = true
 
Set rs_BilletScanX = rs_BilletScanX_cmd.Execute
rs_BilletScanX_numRows = 0
%>
<%
 
 
Set rs_BilletInvRipsawBilletUsageView_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletInvRipsawBilletUsageView_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletInvRipsawBilletUsageView_cmd.CommandText = "SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM dbo.Billet_InventoryANDRipsawBilletUsage" 
rs_BilletInvRipsawBilletUsageView_cmd.Prepared = true
 
Set rs_BilletInvRipsawBilletUsageView = rs_BilletInvRipsawBilletUsageView_cmd.Execute
rs_BilletInvRipsawBilletUsageView_numRows = 0
%>
<%
 
 
Repeat2__numRows = 10
Repeat2__index = 0
rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
 
' set the record count
rs_RipsawBilletUsage_total = rs_RipsawBilletUsage.RecordCount
 
' set the number of rows displayed on this page
If (rs_RipsawBilletUsage_numRows < 0) Then
  rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
Elseif (rs_RipsawBilletUsage_numRows = 0) Then
  rs_RipsawBilletUsage_numRows = 1
End If
 
' set the first and last displayed record
rs_RipsawBilletUsage_first = 1
rs_RipsawBilletUsage_last  = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
 
' if we have the correct record count, check the other stats
If (rs_RipsawBilletUsage_total <> -1) Then
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (rs_RipsawBilletUsage_total = -1) Then
 
  ' count the total records by iterating through the recordset
  rs_RipsawBilletUsage_total=0
  While (Not rs_RipsawBilletUsage.EOF)
    rs_RipsawBilletUsage_total = rs_RipsawBilletUsage_total + 1
    rs_RipsawBilletUsage.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (rs_RipsawBilletUsage.CursorType > 0) Then
    rs_RipsawBilletUsage.MoveFirst
  Else
    rs_RipsawBilletUsage.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (rs_RipsawBilletUsage_numRows < 0 Or rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
 
  ' set the first and last displayed record
  rs_RipsawBilletUsage_first = 1
  rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
  
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
 
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
 
 
Set MM_rs    = rs_RipsawBilletUsage
MM_rsCount   = rs_RipsawBilletUsage_total
MM_size      = rs_RipsawBilletUsage_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
rs_RipsawBilletUsage_first = MM_offset + 1
rs_RipsawBilletUsage_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (rs_RipsawBilletUsage_first > MM_rsCount) Then
    rs_RipsawBilletUsage_first = MM_rsCount
  End If
  If (rs_RipsawBilletUsage_last > MM_rsCount) Then
    rs_RipsawBilletUsage_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
 
 
' 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
 
 
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
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Billet Scan Defects</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	background-image: url(images/lightlogo60.gif);
}
.style5 {
	color: #FFFFFF;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
 
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body bgcolor="#FFFFCC">
<form name="form1" method="POST" action="<%=MM_editAction%>">
 
<table  border="2" cellpadding="2" cellspacing="0" bordercolor="#000000" background="images/lightlogo60.gif" id="BilletDefects">
  <tr bgcolor="#000000">
    <td><span class="style5">Tag Number </span></td>
    <td><span class="style5">Oper. Name</span></td>
	<td><span class="style5">Date Scanned</span></td>
	<td colspan="5" rowspan="2"><span class="style5"></span><span class="style5"></span><span class="style5"></span><span class="style5"></span>
	  <input type="hidden" name="Grade">
	  <input type="hidden" name="Thickness">
	  <input type="hidden" name="Length">
	  <input type="hidden" name="Pieces">	  
	  <input type="hidden" name="shift"></td>
    <td><span class="style5">Rip Width Inch</span></td>
	<td><span class="style5">Rip Width MM</span></td>
    <td><span class="style5">No. of Delams</span></td>
    <td><span class="style5">No.  of M-Blows</span></td>
    <td><span class="style5">No. of U-Blows</span></td>
    <td><span class="style5">  Rough Edges</span></td>
	<td><span class="style5">No. o f Slips</span></td>
    <td><span class="style5">Comments</span></td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
Recordset1.MoveNext
   Wend
 
%>
  <tr bgcolor="#FFFFFF">
    <td><select name="TagNumber"><option value="" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If ("" = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>></option>
      <%
While (NOT rs_BilletScanX.EOF)
%>
      <option value="<%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%>" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If (CStr(rs_BilletScanX.Fields.Item("TagNumber").Value) = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%></option>
      <%
  rs_BilletScanX.MoveNext()
Wend
If (rs_BilletScanX.CursorType > 0) Then
  rs_BilletScanX.MoveFirst
Else
  rs_BilletScanX.Requery
End If
%></select></td>
 
<%
OpName = trim(request.Form("OperatrName"))
%>
 
 
<td><input type="text" size="10" name="OperatrName" value="<%=Session("OpName")%>"></td>
	<td><input name="RipDefectTimeDate" type="text" value="<%=(rs_BilletScanX.Fields.Item("DateScanned").Value)%>" size="10"></td>
	<td><input type="text" size="10" name="RipWidth"></td>
	<td><input type="text" size="10" name="RipWidth2"></td>
    <td><input type="text" size="10" name="Delam"></td>
    <td><input type="text" size="10" name="M_Blow"></td>
    <td><input type="text" size="10" name="U_Blow"></td>
    <td><input type="text" size="10" name="RoughEdge"></td>
	<td><input type="text" size="10" name="Slip"></td>
    <td><input type="text" size="10" name="Other"></td>
  </tr>
</table>
  <input type="submit" name="Submit" value="Submit">
  <input type="hidden" name="MM_insert" value="form1">
</form> <p><strong>To Make corrections "Click" TagNumber below</strong></p>
<table border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr>
    <td align="left" width="11%"> TagNumber </td>
    <td align="left" width="11%"> OperatorName </td>
	<td align="left" width="11%"> Date Scanned</td>
    <td align="left" width="11%"> RipWidth Inch</td>
	<td align="left" width="11%"> RipWidth MM </td>
    <td align="left" width="11%"> Delam </td>
    <td align="left" width="11%"> M_Blow </td>
    <td align="left" width="11%"> U_Blow </td>
    <td align="left" width="11%"> RoughEdge </td>
    <td align="left" width="11%"> Slip </td>
    <td align="left" width="11%">Comments</td>
  </tr>
  <% 
While ((Repeat2__numRows <> 0) AND (NOT rs_RipsawBilletUsage.EOF)) 
%>
    <tr>
<td class="tdResult"><a href="cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage("RipDefectID") %>" onClick="window.open('cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage("RipDefectID") %>','popup','width=300,height=375,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><%=rs_RipsawBilletUsage("TagNumber")%></a></td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("OperatorName").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipDefectTimeDate").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth2").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Delam").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("M_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("U_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RoughEdge").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Slip").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Other").Value)%> </td>
    </tr>
    <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_RipsawBilletUsage.MoveNext()
Wend
%>
</table>
<br>
<table width="50%" border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr bgcolor="#CCCCCC">
    <td width="23%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_moveFirst%>">First</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="31%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_movePrev%>">Previous</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveNext%>">Next</a>
          <% End If ' end Not MM_atTotal %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveLast%>">Last</a>
          <% End If ' end Not MM_atTotal %>
    </td>
  </tr>
</table>
<strong>Records</strong> <%=(rs_RipsawBilletUsage_first)%> <strong>to</strong> <%=(rs_RipsawBilletUsage_last)%> <strong>of</strong> <%=(rs_RipsawBilletUsage_total)%>
 
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rs_RipsawBilletUsage.Close()
Set rs_RipsawBilletUsage = Nothing
%>
<%
rs_BilletScanX.Close()
Set rs_BilletScanX = Nothing
%>
<%
rs_BilletInvRipsawBilletUsageView.Close()
Set rs_BilletInvRipsawBilletUsageView = Nothing
%>
</body>
</html>

Open in new window

This the last page that I fixed the popup on.
But this is DW code, and I did not do that.
Your paging system is DW paging.

Good Luck
Carrzkiss
carrzkiss,

Just tried to include your updated code in this page. I got the following error:

Response object error 'ASP 0251 : 80004005'

Response Buffer Limit Exceeded

/pacinet/BilletScanner/BilletScanDefects_new1.asp, line 0

Execution of the ASP page caused the Response Buffer to exceed its configured limit

Here is a copy of the page as it is now.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/LISADATACONNECT.asp" -->
<!--#include file="dim.asp"-->
<%
 
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
 
' boolean to abort record edit
MM_abortEdit = false
 
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
 
If (CStr(Request("MM_insert")) = "form1") Then
 
  MM_editConnection = MM_LISADATACONNECT_STRING
  MM_editTable = "dbo.RipsawBilletUsage"
  MM_editRedirectUrl = "BilletScanDefects_new1.asp"
  MM_fieldsStr  = "TagNumber|value|RipDefectTimeDate|value|OperatrName|value|Grade|value|Thickness|value|Length|value|Pieces|value|Shift|value|RipWidth|value|RipWidth2|value|Delam|value|M_Blow|value|U_Blow|value|RoughEdge|value|Slip|value|Other|value"
  MM_columnsStr = "TagNumber|',none,''|RipDefectTimeDate|',none,''|OperatorName|',none,''|Grade|',none,''|Thickness|',none,''|Length|',none,''|Pieces|',none,''|Shift|',none,''|RipWidth|',none,''|RipWidth2|',none,''|Delam|',none,''|M_Blow|',none,''|U_Blow|',none,''|RoughEdge|',none,''|Slip|',none,''|Other|',none,''"
 
  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next
 
  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If
 
End If
%>
<%
 
 
If (CStr(Request("MM_insert")) <> "") Then
Session("OpName") = trim(request.Form("OperatrName"))
 
 
  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
 
  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If
 
End If
%>
<%
' *** Edit Operations: declare variables
 
 
 
 
' in your code below, you are using a wildcard:  SELECT *
' this is not good practice, you should spell out all the fields that are going to be used in your code.
' Never use the Wildcard unless it is specifically called for, and you have to use it due to a coding issue.
 
 
Set getSQL = Server.CreateObject("ADODB.Command")
getSQL.ActiveConnection=MM_LISADATACONNECT_STRING
getSQL.commandtext = "SELECT BilletID, TagNumber, ScanTo, DateScanned, TagGroup, TagShift FROM BilletScanX"
set objRs = getSQL.execute
set objRs1 = getSQL.execute
%>
<%
 
 
Set rs_RipsawBilletUsage_cmd = Server.CreateObject ("ADODB.Command")
rs_RipsawBilletUsage_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_RipsawBilletUsage_cmd.CommandText = "SELECT * FROM dbo.RipsawBilletUsage ORDER BY RipDefectTimeDate DESC" 
rs_RipsawBilletUsage_cmd.Prepared = true
 
Set rs_RipsawBilletUsage = rs_RipsawBilletUsage_cmd.Execute
rs_RipsawBilletUsage_numRows = 0
%>
<%
 
 
Set rs_BilletScanX_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletScanX_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletScanX_cmd.CommandText = " SELECT Top 50 * FROM dbo.BilletScanX WHERE     (ScanTo LIKE 'RIPAUTO') ORDER BY BilletID DESC" 
rs_BilletScanX_cmd.Prepared = true
 
Set rs_BilletScanX = rs_BilletScanX_cmd.Execute
rs_BilletScanX_numRows = 0
%>
<%
 
 
Set rs_BilletInvRipsawBilletUsageView_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletInvRipsawBilletUsageView_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletInvRipsawBilletUsageView_cmd.CommandText = "SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM dbo.Billet_InventoryANDRipsawBilletUsage" 
rs_BilletInvRipsawBilletUsageView_cmd.Prepared = true
 
Set rs_BilletInvRipsawBilletUsageView = rs_BilletInvRipsawBilletUsageView_cmd.Execute
rs_BilletInvRipsawBilletUsageView_numRows = 0
%>
<%
 
 
Repeat2__numRows = 10
Repeat2__index = 0
rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
 
' set the record count
rs_RipsawBilletUsage_total = rs_RipsawBilletUsage.RecordCount
 
' set the number of rows displayed on this page
If (rs_RipsawBilletUsage_numRows < 0) Then
  rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
Elseif (rs_RipsawBilletUsage_numRows = 0) Then
  rs_RipsawBilletUsage_numRows = 1
End If
 
' set the first and last displayed record
rs_RipsawBilletUsage_first = 1
rs_RipsawBilletUsage_last  = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
 
' if we have the correct record count, check the other stats
If (rs_RipsawBilletUsage_total <> -1) Then
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (rs_RipsawBilletUsage_total = -1) Then
 
  ' count the total records by iterating through the recordset
  rs_RipsawBilletUsage_total=0
  While (Not rs_RipsawBilletUsage.EOF)
    rs_RipsawBilletUsage_total = rs_RipsawBilletUsage_total + 1
    rs_RipsawBilletUsage.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (rs_RipsawBilletUsage.CursorType > 0) Then
    rs_RipsawBilletUsage.MoveFirst
  Else
    rs_RipsawBilletUsage.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (rs_RipsawBilletUsage_numRows < 0 Or rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
 
  ' set the first and last displayed record
  rs_RipsawBilletUsage_first = 1
  rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
  
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
 
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
 
 
Set MM_rs    = rs_RipsawBilletUsage
MM_rsCount   = rs_RipsawBilletUsage_total
MM_size      = rs_RipsawBilletUsage_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
rs_RipsawBilletUsage_first = MM_offset + 1
rs_RipsawBilletUsage_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (rs_RipsawBilletUsage_first > MM_rsCount) Then
    rs_RipsawBilletUsage_first = MM_rsCount
  End If
  If (rs_RipsawBilletUsage_last > MM_rsCount) Then
    rs_RipsawBilletUsage_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
 
 
' 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
 
 
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
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Billet Scan Defects</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	background-image: url(images/lightlogo60.gif);
}
.style5 {
	color: #FFFFFF;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
<script type="text/javascript"> 
if(window.addEventListener){ 
window.addEventListener('load',switchme,false); 
} 
else { 
if(window.attachEvent){ 
window.attachEvent('onload',switchme); 
} 
} 
 
function switchme(){ 
 
df=document.forms[0]; 
 
df[0].onchange=function(){ 
 
switch(this.value) { 
<%
While (NOT objRs.EOF)
'the df[2] line:35 & 42   this is the form Element Number, For the Fieldname: RipDefectTimeDate   DO NOT CHANGE%>
case '<%=objRs("BilletID")%>': 
df[2].value='<%=objRs("DateScanned")%>'; 
break; 
 
<%objRs.movenext
wend%>
 
default: 
df[2].value=''; 
break; 
} 
} 
} 
</script> 
</head>
<body>
<form name="form1" method="POST" action="<%=MM_editAction%>">
 
<table  border="2" cellpadding="2" cellspacing="0" bordercolor="#000000" background="images/lightlogo60.gif" id="BilletDefects">
  <tr bgcolor="#000000">
    <td><span class="style5">Tag Number </span></td>
    <td><span class="style5">Oper. Name</span></td>
	<td><span class="style5">Date Scanned</span></td>
    <td><span class="style5">Rip Width Inch</span></td>
	<td><span class="style5">Rip Width MM</span></td>
    <td><span class="style5">No. of Delams</span></td>
    <td><span class="style5">No.  of M-Blows</span></td>
    <td><span class="style5">No. of U-Blows</span></td>
    <td><span class="style5">  Rough Edges</span></td>
	<td><span class="style5">No. o f Slips</span></td>
    <td><span class="style5">Comments</span></td>
    <td>&nbsp;</td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT objRs1.EOF))
objRs1.MoveNext
   Wend
 
%>
  <tr bgcolor="#FFFFFF">
    <td><select name="TagNumber">
<option value="Choose One" selected="selected">Choose One</option>  
<%While NOT objRs1.EOF%>
<option value="<%=objRs1("BilletID")%>"><%=objRs1("TagNumber")%></option> 
<%objRs1.movenext
wend%>
</select> </td>
 
<%
OpName = trim(request.Form("OperatrName"))
%>
<div id="ExtraInfos">Select search option</div> 
 
<td><input type="text" size="10" name="OperatrName" value="<%=Session("OpName")%>"></td>
	<td><input name="RipDefectTimeDate" type="text" size="10"></td>
	<td><input type="text" size="10" name="RipWidth"></td>
	<td><input type="text" size="10" name="RipWidth2"></td>
    <td><input type="text" size="10" name="Delam"></td>
    <td><input type="text" size="10" name="M_Blow"></td>
    <td><input type="text" size="10" name="U_Blow"></td>
    <td><input type="text" size="10" name="RoughEdge"></td>
	<td><input type="text" size="10" name="Slip"></td>
    <td><input type="text" size="10" name="Other"></td>
    <%'I had to move these hidden form elements over here, as they were messing up my Form Count    DO NOT MOVE!!!!!%>
    <td colspan="5" rowspan="2"><span class="style5"></span><span class="style5"></span><span class="style5"></span><span class="style5"></span>
	  <input type="hidden" name="Grade">
	  <input type="hidden" name="Thickness">
	  <input type="hidden" name="Length">
	  <input type="hidden" name="Pieces">	  
	  <input type="hidden" name="shift"></td>
      <%'End of moved 'hidden' form elements  DO NOT MOVE!!!!!!!!!!%>
  </tr>
</table>
  <input type="submit" name="Submit" value="Submit">
  <input type="hidden" name="MM_insert" value="form1">
</form>
 <p><strong>To Make corrections "Click" TagNumber below</strong></p>
<table border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr>
    <td align="left" width="11%"> TagNumber </td>
    <td align="left" width="11%"> OperatorName </td>
	<td align="left" width="11%"> Date Scanned</td>
    <td align="left" width="11%"> RipWidth Inch</td>
	<td align="left" width="11%"> RipWidth MM </td>
    <td align="left" width="11%"> Delam </td>
    <td align="left" width="11%"> M_Blow </td>
    <td align="left" width="11%"> U_Blow </td>
    <td align="left" width="11%"> RoughEdge </td>
    <td align="left" width="11%"> Slip </td>
    <td align="left" width="11%">Comments</td>
  </tr>
  <% 
While ((Repeat2__numRows <> 0) AND (NOT rs_RipsawBilletUsage.EOF)) 
%>
    <tr>
<td class="tdResult"><a href="cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage("RipDefectID") %>" onClick="window.open('cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage("RipDefectID") %>','popup','width=300,height=375,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><%=rs_RipsawBilletUsage("TagNumber")%></a></td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("OperatorName").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipDefectTimeDate").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth2").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Delam").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("M_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("U_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RoughEdge").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Slip").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Other").Value)%> </td>
    </tr>
    <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_RipsawBilletUsage.MoveNext()
Wend
%>
</table>
<br>
<table width="50%" border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr bgcolor="#CCCCCC">
    <td width="23%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_moveFirst%>">First</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="31%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_movePrev%>">Previous</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveNext%>">Next</a>
          <% End If ' end Not MM_atTotal %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveLast%>">Last</a>
          <% End If ' end Not MM_atTotal %>
    </td>
  </tr>
</table>
<strong>Records</strong> <%=(rs_RipsawBilletUsage_first)%> <strong>to</strong> <%=(rs_RipsawBilletUsage_last)%> <strong>of</strong> <%=(rs_RipsawBilletUsage_total)%>
 
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rs_RipsawBilletUsage.Close()
Set rs_RipsawBilletUsage = Nothing
%>
<%
rs_BilletScanX.Close()
Set rs_BilletScanX = Nothing
%>
<%
rs_BilletInvRipsawBilletUsageView.Close()
Set rs_BilletInvRipsawBilletUsageView = Nothing
%>
</body>
</html>

Open in new window

Here is the paging system you last made but it was not used in the last example you did on fixing the pop up page.

This paging system still has the "Dim's" in it and will have to come out...right?

Also I will have to change the name of the record set "rs_BIRBU" to "rs_RipsawBilletUsage" for it to work in my app.
<%
Dim rs_BIRBU
Dim rs_BIRBU_cmd
Dim rs_BIRBU_numRows
 ' Sam, please, you DO NOT have to use   dbo.RipsawBilletUsage   the dbo. in your Statements, just the TableName is fine.
Set rs_BIRBU_cmd = Server.CreateObject ("ADODB.Command")
rs_BIRBU_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BIRBU_cmd.CommandText = "SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM RipsawBilletUsage" 
rs_BIRBU_cmd.Prepared = true
 
Set rs_BIRBU = rs_BIRBU_cmd.Execute
rs_BIRBU_numRows = 0
%>
 
<%
 
' I think changing the record set name is confusing me in trying to connect to our database. I will begin to shorten and better name them in the future but if you could this time not change the name it would help. I will better understand it this way.
 
 
' Changed to make short and easier to work with. Try not to have your RecordSet name to long, as it is harder to write out and can make things messy and well, it looks crappy.
' changed:   rs_Billet_Inv_RipsawBilletUsage    to  rs_BIRBU
 
Set rs_BIRBU=CreateObject("ADODB.RecordSet")
'To change the Number of Records to display per page result, you will do it, Change the # 20 to what ever you want it to be.
if request("NumPerPage") <> 0 Then NumPerPage = Int(request("NumPerPage")) Else NumPerPage = 10 end if
' You always want to spell out every Column Name. This take less time to retrieve the records, and is less strain on your server when calling BIG results back when using the wildcard   SELECT * FROM RipsawBilletUsage. DW produces this, even though it is pour programming.
' If you want to get all the Column Names then use Access (or) SQL Server to create a [Query] and click to add every Column Name into the Query, and then Generate the SQL. Then Copy and paste the SQL Select Statement into this area, and IF you are using ONLY ONE table, then you can remember the TableName from each ColumnName to make the Statement smaller and better to manage. As I did here.
sql="SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM RipsawBilletUsage"
 
' This area below to line #35 (cs = 1) is information for the Paging properties, DO NOT Edit these area's If you want to change the name of your RecordSet then you can change its values before, and you are using SQL Server and want to change everything to work with Procedures, then you will change the line #26 to its values.
	 if Request.QueryString("page") = "" Then
    CurrentPage = 1 'We're On the first page
	NumPerPageOf = 1
    Else
    CurrentPage = CInt(Request.QueryString("page"))
	NumPerPageOf = ((CurrentPage * NumPerPage) - NumPerPage) + 1
    End if
    rs_BIRBU.open sql, MM_LISADATACONNECT_STRING,3,3
    Number = rs_BIRBU.RecordCount
    if Not rs_BIRBU.EOF Then
    	rs_BIRBU.MoveFirst
    	rs_BIRBU.PageSize = NumPerPage
    TotalPages = rs_BIRBU.PageCount
    rs_BIRBU.AbsolutePage = CurrentPage
    End if
    ScriptName = request.servervariables("ScriptName")
	cs = 1
	
	
' 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	
%>
 
 
<%
    'This is for your Paging, this will show you how much data you have in the table and what page # you are on, and how many pages you have left
    response.write "<br/><br/><hr style=""background-color:#CCCCCC"">Showing page <strong>" & CurrentPage & "</strong> of <strong>" & TotalPages & "</strong>: Total of results: <strong>" & Number & "</strong>"%>
<%'This is the HEADER of your Table, You notice how it is above the ASP WHILE loop, that is to make sure that it only displays 1 time, as it is not needed no more than once.%>
<table id="MainTable">
  <tr>
    <td class="tdResults"><strong>Tag Number </strong></td>
    <td class="tdResults"><strong>Operator Name</strong></td>
    <td class="tdResults"><strong>Rip Width</strong></td>
    <td class="tdResults"><strong>Delam</strong></td>
    <td class="tdResults"><strong>M-Blow </strong></td>
    <td class="tdResults"><strong>U-Blow</strong></td>
    <td class="tdResults"><strong>Rough Edge </strong></td>
    <td class="tdResults"><strong>Slip</strong></td>
    <td class="tdResults"><strong>Other</strong></td> 
  </tr>
         <%' This is going to count your records and return the amount of records that are needed to fill the page. In this case we need to only display [20] records and that is what we are going to get from this count.
	    While Not rs_BIRBU.EOF and Count < rs_BIRBU.PageSize
    count = count + 1
%>
<tr><%'And of course, this is your Records table, as it is held within the WHILE and the WEND, so that it can repeat itself to display all the records that are needed to display, in this case, we are only wanting to show 20 records at a time.%>
      <td class="tdResult"><a href="cr4.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_BIRBU("RipDefectID") %>" onClick="window.open('cr4.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_BIRBU("RipDefectID") %>','popup','width=300,height=375,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><%=rs_BIRBU("TagNumber")%></a></td>
      <td class="tdResult"><%=rs_BIRBU("OperatorName")%></td>
      <td class="tdResult"><%=rs_BIRBU("RipWidth")%></td>
      <td class="tdResult"><%=rs_BIRBU("Delam")%></td>
      <td class="tdResult"><%=rs_BIRBU("M_Blow")%></td>
      <td class="tdResult"><%=rs_BIRBU("U_Blow")%></td>
      <td class="tdResult"><%=rs_BIRBU("RoughEdge")%></td>
      <td class="tdResult"><%=rs_BIRBU("Slip")%></td>
      <td class="tdResult"><%=rs_BIRBU("Other")%></td>
  </tr>
        <%
' Move to the next record in the table and display to the end. In this case, we are displaying to show 20 records at a time.		
    rs_BIRBU.MoveNext
	Wend
	rs_BIRBU.Close ' close the recordset, as it is not longer needed anymore.
	Set rs_BIRBU=Nothing
%>
</table>
<%
    'Creating the paging numbers
    'Display PREV page link, if appropriate
	' DO NOT mess with this area, ONLY if you need to change the QueryString around.
	'Example: ?NumPerPage
	' Lets say that you are doing Queries, then you would change it to suit your Query.
	' Example: ?id="&id&"&amp;NumPerPage
	' As you see in the above Example, i kept the ? and the NumPerPage, and added in my Query inbewteen them.
	' If you do use a Query, then you will need to change every place that it is needed. There are 5 area's
    if Not CurrentPage = 1 Then
    	Response.Write "<A href='" & ScriptName & "?NumPerPage=" & NumPerPage & "&amp;page=" & CurrentPage - 1 & "'><font size=1 face=Verdana><strong>..</strong></font></A>  "
    if CurrentPage > 5 and TotalPages > 10 Then
    Response.write("<A href=" & ScriptName & "?NumPerPage=" & NumPerPage & "&page=1><font size=1 face=Verdana><strong>1</strong></font></A>" & "<font size=1 face=Verdana><strong> ... </strong> </font>" )
    End if
    if TotalPages > 10 Then
    	
    	if CurrentPage > 5 Then
    		if TotalPages > (CurrentPage + 5) Then
    			ini = (CurrentPage - 4)
    			fim = (CurrentPage + 5)
    		Else
    			ini = (TotalPages - 9)
    			fim = TotalPages
    		End if 
    	Else
    		ini = 1
    		fim = 10
    	End if
    	
    else
    ini=1
    fim = TotalPages
    End if
    For a = ini To fim
    if a = Cint(request("page")) Then
    Response.write( "" & a & "  ")
    Else
    Response.write("<A href=" & ScriptName & "?NumPerPage=" & NumPerPage & "&amp;page=" & a &"><font size=1 face=Verdana><strong>" & a & "</strong></font></A>" & "  " )
    End if
    Next
    Else
    	if TotalPages = 1 Then 
    			Response.write ""
    		Else
    			Response.Write "<font face=Verdana color=#FF0000 size=3><strong>1</strong></font>  "
    	End if
    	if TotalPages > 10 Then     'id=161&MWC=Layouts
    	fim = 10
    	Else
    	fim = TotalPages
    	End if
    	For a = 2 To fim
    if a = Cint(request("page")) Then
    Response.write( "<font face=Verdana color=#FF0000 size=3><strong>" & a & "</strong></font>  ")
    Else
    Response.write("<A href=" & ScriptName & "?NumPerPage=" & NumPerPage & "&amp;page=" & a &"><font size=1 face=Verdana><strong>" & a & "</strong></font></A>" & "  " )
    End if
    Next
    End if
    if CurrentPage < TotalPages - 5 and TotalPages > 10 Then
    Response.write("<font size=1 face=Verdana><strong>... </strong></font><A href=" & ScriptName & "?NumPerPage=" & NumPerPage & "&amp;page=" & TotalPages &"><font size=1 face=Verdana><strong>" & TotalPages & "</strong></font></A>" & "  " )
    End if
	
	
 
    'Display NEXT page link, if appropriate
    if Not CurrentPage = TotalPages Then
    	Response.Write "<A href='" & ScriptName & "?NumPerPage=" & NumPerPage & "&amp;page=" & CurrentPage + 1 & "'><font size=1 face=Verdana><strong>..</strong></font></a>"
    Else
    	Response.Write ""
    End if
    %>

Open in new window

Just added this line after the first line on the page:

<%Response.Buffer = False%>

The page took a very long time to load but if finally did. There were no forms just the background image.

Any ideas?
This is my code.
http://ee.cffcs.com/Q_24798150/BilletScanDefects4.asp
code
http://ee.cffcs.com/Q_24798150/Q_24798150.zip

This is taken from code used here: https://www.experts-exchange.com/questions/24786342/Convert-Dreamweaver-ASP-code-to-hand-coded-ASP-code.html
I ask that you please use this code, it does everything that you need it to do.

This is absolutely the last time that I am going to mess with any of your post
That have "DW" generated code in it.
If you want my assistance in the future at any time.
Make sure that you deal only with Hand Coded.
I have given you enough examples to get you far in your projects.

Have a good one Sam.
Good Luck, and as for the Google stuff, not interested.
I am only Interested in you doing what I ask & teach you to do.
Other than that, that is all that you can do for me on EE any way.

Later
Carrzkiss
carrzkiss,

I have added the last colum to the form. It will load in the browser and submit to the db. But the page while loaded will not see the records.

If you can fix the "TagNumber" and "DateScanned" in this hand code & dw page this is done and I will have the time to study your examples and redo everything by your example.

If not then I will start tomorrow taking each of your examples and putting them together.

Here's what the page looks like now.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/LISADATACONNECT.asp" -->
<!--#include file="dim.asp"-->
<%
 
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
 
' boolean to abort record edit
MM_abortEdit = false
 
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
 
If (CStr(Request("MM_insert")) = "form1") Then
 
  MM_editConnection = MM_LISADATACONNECT_STRING
  MM_editTable = "dbo.RipsawBilletUsage"
  MM_editRedirectUrl = "BilletScanDefects_new1.asp"
  MM_fieldsStr  = "TagNumber|value|RipDefectTimeDate|value|OperatrName|value|Grade|value|Thickness|value|Length|value|Pieces|value|Shift|value|RipWidth|value|RipWidth2|value|Delam|value|M_Blow|value|U_Blow|value|RoughEdge|value|Slip|value|Other|value|ScanTo|value"
  MM_columnsStr = "TagNumber|',none,''|RipDefectTimeDate|',none,''|OperatorName|',none,''|Grade|',none,''|Thickness|',none,''|Length|',none,''|Pieces|',none,''|Shift|',none,''|RipWidth|',none,''|RipWidth2|',none,''|Delam|',none,''|M_Blow|',none,''|U_Blow|',none,''|RoughEdge|',none,''|Slip|',none,''|Other|',none,''|ScanTo|',none,''"
 
  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next
 
  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If
 
End If
%>
<%
 
 
If (CStr(Request("MM_insert")) <> "") Then
Session("OpName") = trim(request.Form("OperatrName"))
 
 
  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
 
  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
 
    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If
 
End If
%>
<%
' *** Edit Operations: declare variables
 
 
 
 
' in your code below, you are using a wildcard:  SELECT *
' this is not good practice, you should spell out all the fields that are going to be used in your code.
' Never use the Wildcard unless it is specifically called for, and you have to use it due to a coding issue.
 
 
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_LISADATACONNECT_STRING
Recordset1.Source = "SELECT *  FROM dbo.BilletScanX  ORDER BY BilletID DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
 
Recordset1_numRows = 0
%>
<%
 
 
Set rs_RipsawBilletUsage_cmd = Server.CreateObject ("ADODB.Command")
rs_RipsawBilletUsage_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_RipsawBilletUsage_cmd.CommandText = "SELECT * FROM dbo.RipsawBilletUsage WHERE (ScanTo LIKE 'RIPAUTO2')" 
rs_RipsawBilletUsage_cmd.Prepared = true
 
Set rs_RipsawBilletUsage = rs_RipsawBilletUsage_cmd.Execute
rs_RipsawBilletUsage_numRows = 0
%>
<%
 
 
Set rs_BilletScanX_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletScanX_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletScanX_cmd.CommandText = " SELECT Top 50 * FROM dbo.BilletScanX WHERE     (ScanTo LIKE 'RIPAUTO') ORDER BY BilletID DESC" 
rs_BilletScanX_cmd.Prepared = true
 
Set rs_BilletScanX = rs_BilletScanX_cmd.Execute
rs_BilletScanX_numRows = 0
%>
<%
 
 
Set rs_BilletInvRipsawBilletUsageView_cmd = Server.CreateObject ("ADODB.Command")
rs_BilletInvRipsawBilletUsageView_cmd.ActiveConnection = MM_LISADATACONNECT_STRING
rs_BilletInvRipsawBilletUsageView_cmd.CommandText = "SELECT RipDefectID, RipDefectTimeDate, TagNumber, OperatorName, Grade, Thickness, Length, Pieces, Shift, RipWidth, Delam, M_Blow, U_Blow, RoughEdge, Slip, Other FROM dbo.Billet_InventoryANDRipsawBilletUsage" 
rs_BilletInvRipsawBilletUsageView_cmd.Prepared = true
 
Set rs_BilletInvRipsawBilletUsageView = rs_BilletInvRipsawBilletUsageView_cmd.Execute
rs_BilletInvRipsawBilletUsageView_numRows = 0
%>
<%
 
 
Repeat2__numRows = 10
Repeat2__index = 0
rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_numRows + Repeat2__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
 
 
' set the record count
rs_RipsawBilletUsage_total = rs_RipsawBilletUsage.RecordCount
 
' set the number of rows displayed on this page
If (rs_RipsawBilletUsage_numRows < 0) Then
  rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
Elseif (rs_RipsawBilletUsage_numRows = 0) Then
  rs_RipsawBilletUsage_numRows = 1
End If
 
' set the first and last displayed record
rs_RipsawBilletUsage_first = 1
rs_RipsawBilletUsage_last  = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
 
' if we have the correct record count, check the other stats
If (rs_RipsawBilletUsage_total <> -1) Then
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
 
If (rs_RipsawBilletUsage_total = -1) Then
 
  ' count the total records by iterating through the recordset
  rs_RipsawBilletUsage_total=0
  While (Not rs_RipsawBilletUsage.EOF)
    rs_RipsawBilletUsage_total = rs_RipsawBilletUsage_total + 1
    rs_RipsawBilletUsage.MoveNext
  Wend
 
  ' reset the cursor to the beginning
  If (rs_RipsawBilletUsage.CursorType > 0) Then
    rs_RipsawBilletUsage.MoveFirst
  Else
    rs_RipsawBilletUsage.Requery
  End If
 
  ' set the number of rows displayed on this page
  If (rs_RipsawBilletUsage_numRows < 0 Or rs_RipsawBilletUsage_numRows > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_numRows = rs_RipsawBilletUsage_total
  End If
 
  ' set the first and last displayed record
  rs_RipsawBilletUsage_first = 1
  rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_first + rs_RipsawBilletUsage_numRows - 1
  
  If (rs_RipsawBilletUsage_first > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_first = rs_RipsawBilletUsage_total
  End If
  If (rs_RipsawBilletUsage_last > rs_RipsawBilletUsage_total) Then
    rs_RipsawBilletUsage_last = rs_RipsawBilletUsage_total
  End If
 
End If
%>
<%
' *** Move To Record and Go To Record: declare variables
 
 
Set MM_rs    = rs_RipsawBilletUsage
MM_rsCount   = rs_RipsawBilletUsage_total
MM_size      = rs_RipsawBilletUsage_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
rs_RipsawBilletUsage_first = MM_offset + 1
rs_RipsawBilletUsage_last  = MM_offset + MM_size
 
If (MM_rsCount <> -1) Then
  If (rs_RipsawBilletUsage_first > MM_rsCount) Then
    rs_RipsawBilletUsage_first = MM_rsCount
  End If
  If (rs_RipsawBilletUsage_last > MM_rsCount) Then
    rs_RipsawBilletUsage_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
 
 
' 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
 
 
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
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Billet Scan Defects</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
	background-image: url(images/lightlogo60.gif);
}
.style5 {
	color: #FFFFFF;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
 
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
 
<body bgcolor="#FFFFCC">
<form name="form1" method="POST" action="<%=MM_editAction%>">
 
<table  border="2" cellpadding="2" cellspacing="0" bordercolor="#000000" background="images/lightlogo60.gif" id="BilletDefects">
  <tr bgcolor="#000000">
    <td><span class="style5">Tag Number </span></td>
    <td><span class="style5">Oper. Name</span></td>
	<td><span class="style5">Date Scanned</span></td>
	<td colspan="5" rowspan="2"><span class="style5"></span><span class="style5"></span><span class="style5"></span><span class="style5"></span>
	  <input type="hidden" name="Grade">
	  <input type="hidden" name="Thickness">
	  <input type="hidden" name="Length">
	  <input type="hidden" name="Pieces">	  
	  <input type="hidden" name="shift"></td>
    <td><span class="style5">Rip Width Inch</span></td>
	<td><span class="style5">Rip Width MM</span></td>
    <td><span class="style5">No. of Delams</span></td>
    <td><span class="style5">No.  of M-Blows</span></td>
    <td><span class="style5">No. of U-Blows</span></td>
    <td><span class="style5">  Rough Edges</span></td>
	<td><span class="style5">No. o f Slips</span></td>
    <td><span class="style5">Comments</span></td>
  </tr>
  <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
Recordset1.MoveNext
   Wend
 
%>
  <tr bgcolor="#FFFFFF">
    <td><select name="TagNumber"><option value="" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If ("" = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>></option>
      <%
While (NOT rs_BilletScanX.EOF)
%>
      <option value="<%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%>" <%If (Not isNull((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then If (CStr(rs_BilletScanX.Fields.Item("TagNumber").Value) = CStr((rs_BilletScanX.Fields.Item("TagNumber").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(rs_BilletScanX.Fields.Item("TagNumber").Value)%></option>
      <%
  rs_BilletScanX.MoveNext()
Wend
If (rs_BilletScanX.CursorType > 0) Then
  rs_BilletScanX.MoveFirst
Else
  rs_BilletScanX.Requery
End If
%></select></td>
 
<%
OpName = trim(request.Form("OperatrName"))
%>
 
 
<td><input type="text" size="10" name="OperatrName" value="<%=Session("OpName")%>"></td>
	<td><input name="RipDefectTimeDate" type="text" value="<%=(rs_BilletScanX.Fields.Item("DateScanned").Value)%>" size="10"></td>
	<td><input type="text" size="10" name="RipWidth"></td>
	<td><input type="text" size="10" name="RipWidth2"></td>
    <td><input type="text" size="10" name="Delam"></td>
    <td><input type="text" size="10" name="M_Blow"></td>
    <td><input type="text" size="10" name="U_Blow"></td>
    <td><input type="text" size="10" name="RoughEdge"></td>
	<td><input type="text" size="10" name="Slip"></td>
    <td><input type="text" size="10" name="Other"></td>
	<td><input name="ScanTo" type="hidden" value="<%=(rs_BilletScanX.Fields.Item("ScanTo").Value)%>" size="10"></td>
 
  </tr>
</table>
  <input type="submit" name="Submit" value="Submit">
  <input type="hidden" name="MM_insert" value="form1">
</form> <p><strong>To Make corrections "Click" TagNumber below</strong></p>
<table border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr>
    <td align="left" width="11%"> TagNumber </td>
    <td align="left" width="11%"> OperatorName </td>
	<td align="left" width="11%"> Date Scanned</td>
    <td align="left" width="11%"> RipWidth Inch</td>
	<td align="left" width="11%"> RipWidth MM </td>
    <td align="left" width="11%"> Delam </td>
    <td align="left" width="11%"> M_Blow </td>
    <td align="left" width="11%"> U_Blow </td>
    <td align="left" width="11%"> RoughEdge </td>
    <td align="left" width="11%"> Slip </td>
    <td align="left" width="11%">Comments</td>
	<td align="left" width="11%">ScanTo</td>
 
  </tr>
  <% 
While ((Repeat2__numRows <> 0) AND (NOT rs_RipsawBilletUsage.EOF)) 
%>
    <tr>
<td class="tdResult"><a href="cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage("RipDefectID") %>" onClick="window.open('cr4_new.asp?<%= Server.HTMLEncode(MM_keepBoth) & MM_joinChar(MM_keepBoth) & "RipDefectID=" & rs_RipsawBilletUsage("RipDefectID") %>','popup','width=300,height=375,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><%=rs_RipsawBilletUsage("TagNumber")%></a></td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("OperatorName").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipDefectTimeDate").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth").Value)%> </td>
	  <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RipWidth2").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Delam").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("M_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("U_Blow").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("RoughEdge").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Slip").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("Other").Value)%> </td>
      <td align="left" width="11%"><%=(rs_RipsawBilletUsage.Fields.Item("ScanTo").Value)%> </td>	  
    </tr>
    <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rs_RipsawBilletUsage.MoveNext()
Wend
%>
</table>
<br>
<table width="50%" border="1" align="center" bordercolor="#000000" bgcolor="#CCCCCC">
  <tr bgcolor="#CCCCCC">
    <td width="23%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_moveFirst%>">First</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="31%" align="center"><% If MM_offset <> 0 Then %>
          <a href="<%=MM_movePrev%>">Previous</a>
          <% End If ' end MM_offset <> 0 %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveNext%>">Next</a>
          <% End If ' end Not MM_atTotal %>
    </td>
    <td width="23%" align="center"><% If Not MM_atTotal Then %>
          <a href="<%=MM_moveLast%>">Last</a>
          <% End If ' end Not MM_atTotal %>
    </td>
  </tr>
</table>
<strong>Records</strong> <%=(rs_RipsawBilletUsage_first)%> <strong>to</strong> <%=(rs_RipsawBilletUsage_last)%> <strong>of</strong> <%=(rs_RipsawBilletUsage_total)%>
 
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rs_RipsawBilletUsage.Close()
Set rs_RipsawBilletUsage = Nothing
%>
<%
rs_BilletScanX.Close()
Set rs_BilletScanX = Nothing
%>
<%
rs_BilletInvRipsawBilletUsageView.Close()
Set rs_BilletInvRipsawBilletUsageView = Nothing
%>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
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
carrzkiss,

Sorry for the trouble. I will not use dw again. This app was being used on the floor and I kept getting changes. A lot of pressure was on me over it. I don't have it now and I have time to study all your examples.

 I will visit your site and contact you there as I have something to teach you. You have a gold mine in your head and I am pretty sure I can show you how to get some of it out.