I have a form that is created with a database query using data from a previous form. I need to add information to one field and then process it when the user selects a button within the same form and can't seem to get the procedure to run on the click. I have attached the primary code portion below, can anyone tell me what I am doing wrong.
<HTML><HEAD><TITLE>Page Title</TITLE></HEAD>
<%Sub ValPost()
'processing done here but a msgbox for testing and isn't working
msgbox "Run"
End Sub %>
<% ' Database connection code here %>
<% ' Get Passed Data From Previous Form
arySell=Split(Request.Form("Previous"
,","
%>
<FORM>
<TABLE width="640" border = 1 cellpadding=2 cellspacing=0 rules=rows frame=void>
<% For intCount = 0 to UBOUND(arySell) %>
<% Set oRs = oConn.Execute("SELECT Type, Description, Marked, Cost, Source FROM tblData WHERE Index = " & arySell(intCount))
<TABLE width="640" border = 1 cellpadding=2 cellspacing=0 rules=rows frame=void>
' ShowValues is Function for Formatting text and numeric data
sType = ShowValues(oRs("Type"
,0)
sDesc = ShowValues(oRs("Description"
,0)
nMarked = ShowValues(oRs("Marked"
,2)
nCost = ShowValues(oRs("Cost"
,2)
sSource = ShowValues(oRs("Source"
,0)
%>
<tr>
<input type=hidden name="Index" value= <%= arySell(intCount) %>>
<td><%= sType %></td>
<td><%= sDesc %></td>
<td><%= nMarked %></td>
<td><%= nCost %></td>
<td><%= sSource %></td>
<td><input type=text name="Sell" value=0>
</tr>
<% Next %>
<tr>
<td colspan=6 align=left><input type="button" On_Click="ValPost" value="Submit"></td>
</tr>
<% 'Close Recordset and Database Here
oRs.close
oConn.close
%>
</TABLE>
</FORM>
<%
Function ShowValues(vData, nType)
Select Case nType
Case 0
If IsNull(vData) Then
ShowValues = " "
else
ShowValues = vData
End If
Case 1
If IsNull(vData) Then
ShowValues = 0
Else
ShowValues = vData
End If
Case 2
If IsNull(vData) Then
ShowValues = FormatNumber(0,2,0,0,0)
Else
ShowValues = FormatNumber(vData,2,0,0,0)
End If
End Select
End Function
%>
</BODY>
</HTML>
<HTML><HEAD><TITLE>Page Title</TITLE></HEAD>
<%Sub ValPost()
'processing done here but a msgbox for testing and isn't working
msgbox "Run"
End Sub %>
<% ' Database connection code here %>
<% ' Get Passed Data From Previous Form
arySell=Split(Request.Form("Previous"
%>
<FORM>
<TABLE width="640" border = 1 cellpadding=2 cellspacing=0 rules=rows frame=void>
<% For intCount = 0 to UBOUND(arySell) %>
<% Set oRs = oConn.Execute("SELECT Type, Description, Marked, Cost, Source FROM tblData WHERE Index = " & arySell(intCount))
<TABLE width="640" border = 1 cellpadding=2 cellspacing=0 rules=rows frame=void>
' ShowValues is Function for Formatting text and numeric data
sType = ShowValues(oRs("Type"
sDesc = ShowValues(oRs("Description"
nMarked = ShowValues(oRs("Marked"
nCost = ShowValues(oRs("Cost"
sSource = ShowValues(oRs("Source"
%>
<tr>
<input type=hidden name="Index" value= <%= arySell(intCount) %>>
<td><%= sType %></td>
<td><%= sDesc %></td>
<td><%= nMarked %></td>
<td><%= nCost %></td>
<td><%= sSource %></td>
<td><input type=text name="Sell" value=0>
</tr>
<% Next %>
<tr>
<td colspan=6 align=left><input type="button" On_Click="ValPost" value="Submit"></td>
</tr>
<% 'Close Recordset and Database Here
oRs.close
oConn.close
%>
</TABLE>
</FORM>
<%
Function ShowValues(vData, nType)
Select Case nType
Case 0
If IsNull(vData) Then
ShowValues = " "
else
ShowValues = vData
End If
Case 1
If IsNull(vData) Then
ShowValues = 0
Else
ShowValues = vData
End If
Case 2
If IsNull(vData) Then
ShowValues = FormatNumber(0,2,0,0,0)
Else
ShowValues = FormatNumber(vData,2,0,0,0)
End If
End Select
End Function
%>
</BODY>
</HTML>