Conditional DRW fields

S

Stephen Green

I'm working on a Database Results page. The database contains contact
information and membership status.

I'd like to be able to show certain fields only if it isn't empty. And then
display a second field based on whether the first is displayed or not. For
instance:

If Membership Status <> ""
Membership Status
Level
Endif

Otherwise nothing should be displayed. Something like a missing address
line on an envelope...

Is that possible within FrontPage (2002) ?

Thanks for your help.

Stephen
 
K

Kathleen Anderson [MVP - FP]

Wrap the DatabaseResultsColumn in some script - like this:


<% If fp_rs("Municipality") > " " then %>

<li><b>Municipality:</b>&nbsp;<!--webbot bot="DatabaseResultColumn"
startspan

s-columnnames="ProgramArea,RecordNum,Date,ItemNumber,SplitItem,Session,PA_SA
,ActNumber,Section,Recipient,Municipality,FundsUse,DollarField1,DollarField2
,DollarField3,DollarField4,Any_Previous,DollarField5,FundNum,AgencyNum,SID,P
roject_Num,Description"
s-column="Municipality" b-tableformat="FALSE" b-hashtml="FALSE"
clientside
preview="&lt;font
size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Municipality&lt;font
size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" b-makelink
b-MenuFormat --><%=FP_FieldVal(fp_rs,"Municipality")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="33247" --></li>

<% End If %>


You can also check the value of one field to determine whether to show
another.
 
T

Thomas A. Rowe

Hand coded, I would do the following (Example is for generating a name and address block):

<%=RS("FullName")%><br>
<%=RS("AddressLine1")%><br>
<% If RS("AddressLine2") <> "" Then %>
<%=RS("AddressLine2")%><br>
<% End If %>
<%=RS("City")%>,&nbsp;<%=RS("State")%>&nbsp;&nbsp;<%=RS("ZipCode")%>

or
<% If RS("AddressLine2") <> "" Then %>
<%=RS("FullName")%><br>
<%=RS("AddressLine1")%><br>
<%=RS("AddressLine2")%><br>
<%=RS("City")%>,&nbsp;<%=RS("State")%>&nbsp;&nbsp;<%=RS("ZipCode")%>
<% Else %>
<%=RS("FullName")%><br>
<%=RS("AddressLine1")%><br>
<%=RS("City")%>,&nbsp;<%=RS("State")%>&nbsp;&nbsp;<%=RS("ZipCode")%>
<% End If %>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Top