foundsheep
Programmer
I'm working on this app that displays parts that need to be reordered. I need it not to show parts that have their recommended stock at zero, and I have yet to figure out the best way to do it. Any help is greatly appreciated. Here's the code:
%
Set rsVen = Server.CreateObject("ADODB.Recordset")
Set rsPrt = Server.CreateObject("ADODB.Recordset")
rsVen.Open "SELECT DISTINCT Company FROM Vendor", db, 3, 3, 1
x = 0
if not rsVen.EOF then
Do Until rsVen.EOF
if Fix(x/2) = x/2 then
dColor = "white"
else
dColor = "#cccccc"
end if
%>
<tr bgColor="<%=dColor%>">
<td colspan="3"><b><%=rsVen("Company")%></b></td>
<%
rsPrt.Open "SELECT * FROM Parts WHERE parVendor = '" & rsVen("Company") & "'", db, 3, 3, 1
if not rsPrt.EOF then
Dim lm
lm = 0
Do Until rsPrt.EOF
If rsPrt("qtyonHand") <= rsPrt("reorderLevel") then
lm = lm + 1
'response.write(lm)
end if
rsPrt.MoveNext
Loop
if lm >= 1 then%>
%
Set rsVen = Server.CreateObject("ADODB.Recordset")
Set rsPrt = Server.CreateObject("ADODB.Recordset")
rsVen.Open "SELECT DISTINCT Company FROM Vendor", db, 3, 3, 1
x = 0
if not rsVen.EOF then
Do Until rsVen.EOF
if Fix(x/2) = x/2 then
dColor = "white"
else
dColor = "#cccccc"
end if
%>
<tr bgColor="<%=dColor%>">
<td colspan="3"><b><%=rsVen("Company")%></b></td>
<%
rsPrt.Open "SELECT * FROM Parts WHERE parVendor = '" & rsVen("Company") & "'", db, 3, 3, 1
if not rsPrt.EOF then
Dim lm
lm = 0
Do Until rsPrt.EOF
If rsPrt("qtyonHand") <= rsPrt("reorderLevel") then
lm = lm + 1
'response.write(lm)
end if
rsPrt.MoveNext
Loop
if lm >= 1 then%>