Forums
This topic is locked
Omitt records from Repeat Region
Posted 23 Aug 2004 07:04:09
1
has voted
23 Aug 2004 07:04:09 Charles Knight posted:
Hi allWonder if you can help.
Need to create a repeat region from a recordset but omitt records that have a certain value in one colum.
Anyone any ideas
Cheers
ck
Replies
Replied 23 Aug 2004 08:02:10
23 Aug 2004 08:02:10 Dan Berdusco replied:
You can just use a simple If - Then statement:
<pre id=code><font face=courier size=2 id=code><%If NOT (RS_Name.Fields.Item("FieldName".Value) = "Your value" Then %> </font id=code></pre id=code>
Put your stuff here that you want to show/hide.
<pre id=code><font face=courier size=2 id=code><% End If %> </font id=code></pre id=code>
That will check so see if the value of a certain field in your database is equal to a specific value. If it is, then it will skip that record.
<pre id=code><font face=courier size=2 id=code><%If NOT (RS_Name.Fields.Item("FieldName".Value) = "Your value" Then %> </font id=code></pre id=code>
Put your stuff here that you want to show/hide.
<pre id=code><font face=courier size=2 id=code><% End If %> </font id=code></pre id=code>
That will check so see if the value of a certain field in your database is equal to a specific value. If it is, then it will skip that record.
Replied 23 Aug 2004 08:18:04
23 Aug 2004 08:18:04 Charles Knight replied:
Wow that was quick.
I tried this:
<%If NOT (RSCat3Details.Fields.Item("completed".Value) = "yes" Then %>
<%=(rsCa3Details.Fields.Item("cat3_id".Value)%></td>
<% End If %>
but get error object require, any thoughts.
I tried another way by filtering the recordset to show only those records which do meet the critera and then repeat those.
Which is the correct way or is'nt there one ?
Cheers
ck
I tried this:
<%If NOT (RSCat3Details.Fields.Item("completed".Value) = "yes" Then %>
<%=(rsCa3Details.Fields.Item("cat3_id".Value)%></td>
<% End If %>
but get error object require, any thoughts.
I tried another way by filtering the recordset to show only those records which do meet the critera and then repeat those.
Which is the correct way or is'nt there one ?
Cheers
ck
Replied 23 Aug 2004 18:46:46
23 Aug 2004 18:46:46 Dan Berdusco replied:
Either way will work. In fact, you are probably better off to just filter the recordset to begin with...
however, you may want to make the "if" statement work properly... Is the "Yes" you are referring to an MS Access Checkbox? If so, then use this statement:
<pre id=code><font face=courier size=2 id=code><%If NOT (RS_Name.Fields.Item("FieldName".Value) = True Then %> </font id=code></pre id=code>
There should be no quotes around the True.
however, you may want to make the "if" statement work properly... Is the "Yes" you are referring to an MS Access Checkbox? If so, then use this statement:
<pre id=code><font face=courier size=2 id=code><%If NOT (RS_Name.Fields.Item("FieldName".Value) = True Then %> </font id=code></pre id=code>
There should be no quotes around the True.
Replied 24 Aug 2004 02:17:32
24 Aug 2004 02:17:32 Charles Knight replied:
Thanks for the advice, the field is a dropdown yes/no. Will try the alternative code and let you know.
Cheers
ck
Cheers
ck