Evert Jor
asked on
Need help to rewrite script
I have this script:
sub pddinstock()
if useStockManagement AND showinstock=TRUE then if cint(rs("pStockByOpts"))=0 then print "<div class=""prodinstock detailinstock""><strong>" & xxInStoc & ":</strong> " & vrmax(0,rs("pInStock")) & "</div>"
end sub
I need to change it so that " & vrmax(0,rs("pInStock")) & " returns an output like "Few items left." instead of the " & vrmax(0,rs("pInStock")) & " value when the value of " & vrmax(0,rs("pInStock")) & " is less than 5 and when the value of " & vrmax(0,rs("pInStock")) & " is more than 5 it should say "In stock."
I have tried to rewrite the script, but as I'm doing it in Notepad I have to test it after each modification and I have still not figured it out. Now I've been at it for a few hours. Anyone know how to rewrite it?
Many thanks in advance.
Best regards,
Evert
sub pddinstock()
if useStockManagement AND showinstock=TRUE then if cint(rs("pStockByOpts"))=0
end sub
I need to change it so that " & vrmax(0,rs("pInStock")) & " returns an output like "Few items left." instead of the " & vrmax(0,rs("pInStock")) & " value when the value of " & vrmax(0,rs("pInStock")) & " is less than 5 and when the value of " & vrmax(0,rs("pInStock")) & " is more than 5 it should say "In stock."
I have tried to rewrite the script, but as I'm doing it in Notepad I have to test it after each modification and I have still not figured it out. Now I've been at it for a few hours. Anyone know how to rewrite it?
Many thanks in advance.
Best regards,
Evert
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent solution.
It looks smt like
sub pddinstock()
if useStockManagement AND showinstock=TRUE then
if cint(rs("pStockByOpts"))=0
'does this means there is stock available
if xxInStock < 5 then msgbox "your message" else msgbox "your second message"
end if
end if
end sub