Results 1 to 8 of 8
  1. #1
    kkukreja is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jan 2011
    Posts
    7

    not null validation

    Hi All ,

    I am connecting oracle 11G database with access and then trying to create a form.
    In the form we have to validate that the text filed is not null.

    I have tried using this simple code :

    if isNull(text0.text) then


    msgbox "null values not allowed"
    end if


    but then its not working.. I am using it in before_update section.

    which code should be used to verify that and also where should i pasting the code.
    I have been trying to fix this since the last 2 days... but its not helping...

    please help me..

    regrads
    kkukreja

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    To catch Zero Length Strings (ZLS) as well use:
    If Len(Me.text0 & "") = 0 Then
    ...and you will notice I used the default .Value instead of the .Text property. The .Value property *is* valid in the BeforeUpdate event.

  3. #3
    kkukreja is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jan 2011
    Posts
    7
    Thanks Sir..
    i have 2 more questions :

    1.How to display column names in the list box ?
    2. Also in my SQL queries I have column aliases that i cannot give with access.. is there any way to use column aliases while using sql queries in access..

    thanks and regards
    kkukreja

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I believe you will find that Display Column Headings is a property of the ListBox Object.

  5. #5
    kkukreja is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jan 2011
    Posts
    7
    Sir ,

    You mean column heads right ? Thanks.. yeah i found that option..

    and just please tell me about the column aliases... i have used NZ for NVL ( in SQL) but what should i use to display columns aliases everywhere..

    thanks
    kkukreja

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I didn't answer that question because I have no idea what you are talking about, sorry.

  7. #7
    kkukreja is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jan 2011
    Posts
    7
    Quote Originally Posted by RuralGuy View Post
    I didn't answer that question because I have no idea what you are talking about, sorry.
    Sir ,

    SORRY if i confused you..

    what i mean is :

    suppose i have this sql query :

    select name 'USER NAME',address 'LOCATION' from table;


    then the aliases that i am using (USER NAME, LOCATION) cant be used and it throws an error...

    how do i used aliases(a different name for column for displaying purpose only) in SQL query that i am accessing from ACCESS..

    thanks
    kKukreja

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Enclosing things in [brackets] will generally keep Access from getting confused.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Validation Rule
    By Megan in forum Access
    Replies: 1
    Last Post: 11-05-2010, 09:45 AM
  2. Validation Rule
    By robomose in forum Access
    Replies: 1
    Last Post: 09-09-2009, 05:59 AM
  3. Validation Rule
    By smitstev in forum Access
    Replies: 5
    Last Post: 06-30-2009, 09:58 AM
  4. Validation problems...
    By dbDamo in forum Forms
    Replies: 1
    Last Post: 05-15-2009, 12:43 PM
  5. Data Validation - Please help
    By larry S in forum Access
    Replies: 0
    Last Post: 11-16-2008, 10:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums