Forums
This topic is locked
Dont show region if total records from rcrdset > 4
Posted 09 May 2007 03:51:50
1
has voted
09 May 2007 03:51:50 Mike Leslie posted:
I am trying to figure out how to NOT show a region if the total records from a recordset is greater than 4, i am using ASP VBscript, and would like to keep it as simple as possible, i would like to find a script or how to modify DW code to not show a region when the total records from a recordset is greater than 4. I am thinking a conditional statement or a script that i put after the recordset code to activate the Show, Dont Show behaviors Replies
Replied 11 May 2007 21:20:13
11 May 2007 21:20:13 Mike Leslie replied:
So simple was the solution this is what i did
first make the recordset- RECORDSET1
then bind the total records asp item on your page(use application- bindings and DW makes the code)
its the tag with:' *** Recordset Stats: if we don't know the record count, manually count them
after the records are totaled in the code declare your variable:
%
Dim mytotal
mytotal = (RECORDSET1_total)
%
Next wrap the code to display when the number is above or below what you choose.
<pre id=code><font face=courier size=2 id=code> % If mytotal < 5 Then %> html code in body of page to display <% End If%</font id=code></pre id=code>
put the opening and closing tags around the aboce code
this will display 'html code in body of page to display' when the total of RECORDSET1 is 5 or more "<" is greater than, and ">" is less than
you can pick the number and use And Or for multiple variable conditions.
Replace the quotes with the proper opening and closing tags and you can remove the (RECORDSET1_total) from your page. <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code>
first make the recordset- RECORDSET1
then bind the total records asp item on your page(use application- bindings and DW makes the code)
its the tag with:' *** Recordset Stats: if we don't know the record count, manually count them
after the records are totaled in the code declare your variable:
%
Dim mytotal
mytotal = (RECORDSET1_total)
%
Next wrap the code to display when the number is above or below what you choose.
<pre id=code><font face=courier size=2 id=code> % If mytotal < 5 Then %> html code in body of page to display <% End If%</font id=code></pre id=code>
put the opening and closing tags around the aboce code
this will display 'html code in body of page to display' when the total of RECORDSET1 is 5 or more "<" is greater than, and ">" is less than
you can pick the number and use And Or for multiple variable conditions.
Replace the quotes with the proper opening and closing tags and you can remove the (RECORDSET1_total) from your page. <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code>