Hi all, I am trying to compare output from DB

The code below works on 1 check, but I require to do this on multiple products like so if rowProduct("GRPCODE") <> "Cross Hire" or rowProduct("GRPCODE") <> "Boiler Ancillaries" then etc

but the above line does not work as I have coded it? What is the problem with the code.

Thanks in advance

if rowProduct("GRPCODE")  <> "Cross Hire" then
                                ' Elimination unwanted code
                                if not rowStock.eof then
                                    ' stock found
                                      do while not rowStock.eof
                                        ' loop through stocl
                                        if instr(RemoveItems, "," & rowStock("ITEMNO") & ",") = 0 then
                                            ' item not removed
                                            StockCount = (StockCount + 1)
                                            if rowStock("QTYHIRE") <> "0" then
                                                ' on hire
                                                StockOnHire = (StockOnHire + 1)
                                            end if' end QTYHIRE
                                            if rowStock("QTYALLOC") <> "0" then
                                                ' allocated  
                                                StockAllocate = (StockAllocate + 1)
                                            end if ' end QTYALLOC if
                                        end if
                                      loop ' end do while
                                end if
                            end if

I think you must insert a check with an "AND" instead of an "OR".
Like this:

if (rowProduct("GRPCODE") <> "Cross Hire" AND rowProduct("GRPCODE") <> "Boiler Ancillaries") then
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.