Testing if a text field is blank?

Results 1 to 2 of 2

Thread: Testing if a text field is blank?

  1. #1
    Burt Lewis Guest

    Default Testing if a text field is blank?

    I&#039m stumped on this.<BR>I have a simple access DB.<BR><BR>I have a field that sometimes is blank and I need to test for it.<BR>Problem is nothing I try works. Works great to test if something is in there &#060;&#062;. But when I try to check for being empty, it acts like it isn&#039t.<BR><BR>This is some of the things I tried so far to find blanks.<BR><BR>if trim(objRst("field7")) = "" then<BR> comma = "YES"<BR> colon = "HELLO" <BR>end if<BR>============<BR>if isempty(objRst("field7")) then<BR> comma = "YES"<BR> colon = "HELLO" <BR>end if<BR><BR>Appreciate any help.<BR>burt@ici.net

  2. #2
    iyyappan n iyer Guest

    Default try IsNull

    v use access. and we always set the default value of a table field as "". bydefault it is null, and null is a programmers enemy.<BR><BR>so, set default, to "".<BR><BR>Then your code should work.<BR><BR>&#039****<BR>if u can&#039t set default to "" then, use IsNull function<BR><BR>for example:<BR><BR>If Not IsNull(Rs("FName")) Then<BR> Response.Write "Name: " & Rs("FName")<BR>Else<BR> Response.Write "Name not available"<BR>End if

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts