Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003

    Unanswered: What is the exact way to check for blank textbox?

    If the textbox is blank there would be an error message for it. For example,

    If txtName = "" then
    msgbox "error message"
    end if

    but sometimes I have to use the IsNull syntax to validate if the text box is blank..

    Why is it one or the other?
    Last edited by lansing; 08-12-04 at 16:54.

  2. #2
    Join Date
    Jun 2004
    Florida, US
    you should always use isnull(), because data in textbox is variant type until you start typing in it. which it might have Null value. you can also use;
    if nz(txtname,"")="" then...
    nz() function returns alternative value if the variant is null. in this case returns empty string if txtname is null.

Posting Permissions

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