473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Hiding blank record data

I want to display the contents of a field with a label if there is data

in that field. If there isn't then I don't want the label to appear.

I tried this:

<%If Venueinfo("email") = "" Then
Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
email</a><br><%End If%>

But it doesn't seem to work. It seems to always display the label and
link even though there is no data in that field.

help?

this is ASP and mysql

Nov 24 '05 #1
3 1555

<ja***********@gmail.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
I want to display the contents of a field with a label if there is data

in that field. If there isn't then I don't want the label to appear.

I tried this:

<%If Venueinfo("email") = "" Then
Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
email</a><br><%End If%>

But it doesn't seem to work. It seems to always display the label and
link even though there is no data in that field.


Is the field really "", or is it Empty, or is it Null?

"" <> Empty <> Null

To cover all the bases:

If Venueinfo("email") = "" Or IsNull(Venueinfo("email")) Or
IsEmpty(Venueinfo("email")) Then
Nov 24 '05 #2
MyndPhlyp wrote:

To cover all the bases:

If Venueinfo("email") = "" Or IsNull(Venueinfo("email")) Or
IsEmpty(Venueinfo("email")) Then


A good hack to use is this:

if Venueinfo("email") & "" = "" then

Given the fact that operations involving Null are supposed to result in
Null, one would not expect this hack to work. However, in both VB and
vbscript, concatenation with Null does not result in Null, so the above hack
works.
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Nov 25 '05 #3

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:e9*************@TK2MSFTNGP15.phx.gbl...
MyndPhlyp wrote:

To cover all the bases:

If Venueinfo("email") = "" Or IsNull(Venueinfo("email")) Or
IsEmpty(Venueinfo("email")) Then


A good hack to use is this:

if Venueinfo("email") & "" = "" then


I almost included that in my earlier reply. Definitely a slick and elegant
hack. I have been aware of it for quite some time but choose not to use it
for a couple of reasons: (a) it relies upon a quirk, and (b) it doesn't
document very well to the unenlightened developer.
Nov 25 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ruben | last post by:
Hello. I am trying to read a small text file using the readline statement. I can only read the first 2 records from the file. It stops at the blank lines or at lines with only spaces. I have a...
0
by: Luke Airig | last post by:
I am trying to merge two xml files based on common date/time and then write out a tab-delimited xml file with the header record from one of the input files concatenated in front of the merged...
19
by: Joe Scully | last post by:
Hi all, I am having trouble with access adding a blank record to a subform everytime I finish entering data and closing the form. (The form and subform are based on the one table) When...
1
by: Tim Graichen | last post by:
Hello, I have a main form with one subform. The main form displays a record from TableOne (PCID) This is a corporate software tracking utility that works like this: Main form...Choose PCID...
1
by: james.shearer | last post by:
I want to display the contents of a field with a label if there is data in that field. If there isn't then I don't want the label to appear. I tried this: <%If Venueinfo("email") = "" Then...
10
by: lorirobn | last post by:
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions,...
4
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that...
5
by: M Skabialka | last post by:
I am creating my first Visual Studio project, an inventory database. I have created a form and used written directions to add data from a table to the form using table adapters, data sets, etc. ...
3
by: Harry2007 | last post by:
How do I get rid of the blank form that attach to the current form when you start to enter data into a continuous form? I want the blank form to only appear after they click on the ADD Record button...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.