Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hide html text when a recordset field is empty

Status
Not open for further replies.

Sdudart

Technical User
Nov 28, 2012
1
BE
Dear all,

I have a bibliographical database. The result page of the web application (write in vbscript) shows a list of bibliographical references with ponctuations thanks to which I separate titel, authors, ... . there are some references (or records) with empty fields (the subtitel or the publisher for example). When these fields are empty I try to do not show the ponctuation for these bibliographical elements (empty fields). I found the code below but it does not work. Could you please take a look at the here down code and help me to solve this problem please ?




<% If BxlCadreJuridique.Fields.Item("ComplementTitre").Value = "" AND BxlCadreJuridique.Fields.Item("ComplementTitre").Value = NULL Then %>
: <%=(BxlCadreJuridique.Fields.Item("ComplementTitre").Value)%> / <% End If %>
 
This is ASP, not VBS. Also, the code you post has no context. Conceptually, however, the posted code will never evaluate to true. How can a value be empty and null at the same time? Again, there is no context so I can't "validate" this change but try changing AND to OR.

-Geates

 
Actually, I think you would want to check for "not equal" instead of equal:

<% If BxlCadreJuridique.Fields.Item("ComplementTitre").Value [highlight #FCE94F]<>[/highlight] "" AND BxlCadreJuridique.Fields.Item("ComplementTitre").Value [highlight #FCE94F]<>[/highlight] NULL Then %>

Also, while you are using vbscript, since you are using it in the context of ASP you might try this forum: forum333
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top