Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    1

    Exclamation Unanswered: Prevent null value in text field

    I am creating a report depending on parameters retrieved from a form. I want to get empty string if the user dose not enter a value in the form. I tried the following condition

    =IIF(isnull(Forms!Form1!text0)=True,"",Forms!Form1 !text0 )

    but it did not work.

    Please help me

    Best regard,
    Hazeem

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    nz(forms!yourform!yourobject, "")
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2006
    Posts
    4

    hidden value in empty field

    Im having the same issue in a date field but im using VB code on a form.

    Try a "Not IsNull" statement to test that your field is actually null. There may be a blank space or other character causing the field to show as not null.

    I can't figure out how to see what value is actually in the field and I'm not sure how to clear it either. sorry..

    Anyone else got ideas?

    thanks

  4. #4
    Join Date
    Feb 2006
    Posts
    59
    There must be an OK button on the form to generate the report. on the click event of that button try this
    if isnull (text0) then
    msgbox"Please Enter a value in text 0"
    me.text0.setfocus
    else
    end if

  5. #5
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,422
    Provided Answers: 8
    Why go back to the table and change and fix the feild propries

    Required = Yes
    Allow Zero Length = No

    I do it @ the table level so the the rules get copied to each form I Created
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

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