urko wrote:
Ok, now the thing is that I would like to use this page for displaying records from catID 1,2,3,4 and 5, but would like to hide above code if catid is 1,2,3 and 5 is displayed!... |
I still don't get the point, your declaration above seam to be in conflict, first you say you want to use the code above to show catID 1,2,3,4,5 then you say you don't want to use the code above to show catID 1,2,3,...,5, just 4. Could it be that you just want to use it to display cat 4?
Another thing with the code is that it's very messy, you could filter cat 4 only on your SQL stat, or on the [While/Wend] loop do this:
While Repeat1__numRows <> 0 And NOT loads.EOF And loads.Fields.Item("catID").Value = 4
...
Wend |
Not my prefered method
Why do you have to reference fields like this: [loads.Fields.Item("catID").Value] can't you just [loads.("catID")] or something?
The prefered method to do what you want would be to add optional fields to your cats table, such as [fldShow] a boolean type setting whether to show this cat or not, and [fldType] a string type defining what this category holds, ex. [ballistic loads, comments, etc], also, you shouldn't be referencing cats by ID, IDs should be dynamic, and may change, even if you hook on the the index ID, which don't change until the records is deleted, next time the category is created a new ID will be assigned to it and your code will not work then.