Show if DB field NOT NULL

K

Keith

What is the correct code to use to hide a section if a specific DB field is
NULL.

Thanks
 
D

Dave Anderson

Keith said:
What is the correct code to use to hide a section if a specific DB
field is NULL.

Define "hide a section".


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
J

Jeff Cochran

What is the correct code to use to hide a section if a specific DB field is
NULL.

Hide a section as in using DHTML to hide/unhide? Try a DHTML group
for that answer.

If you're looking for an ASP-only answer:

IF DBField <> Null Then
Response.Write "Hidden Section"
End If

Jeff
 
K

Keith

Sorry - badly written question.

Hide a section as in don't process a section of the page if a DB field is
NULL
 
B

Bob Barrows [MVP]

Jeff said:
Hide a section as in using DHTML to hide/unhide? Try a DHTML group
for that answer.

If you're looking for an ASP-only answer:

IF DBField <> Null Then
Response.Write "Hidden Section"
End If

Jeff
Minor correction:
IF Not DBField Is Null Then

or

If IsNull(DBField) = False Then

Bob Barrows
 
J

Jeff Cochran

Minor correction:
IF Not DBField Is Null Then

or

If IsNull(DBField) = False Then

Bleh! Should stop answering posts at 2:00 am... :)

Especially since I just ran through an IsNull() programming section
during the day.

Jeff
 
J

Jeff Cochran

Sorry - badly written question.

Hide a section as in don't process a section of the page if a DB field is
NULL

You can't "not process a page" because until you process the page you
can't determine if the field is null. You can branch based on it
being null, or else you'll need to use two pages, or try to accomplish
a conditional include, which is more work thatn the system should do.

Jeff
 
B

Binoj Antony

IF (NOT ISNULL(DBField)) THEN
' Do something
ELSE
' Do Something else
END IF

This works best for me...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top