Results 1 to 2 of 2
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Verify Fields Are Not Null

    I have a form with 2 fields ([field1],[field2]), and on this form there is a button that when pressed will run an update query based off the values of these fields. BEFORE the update query executes, how can I 1st check that [field1] is not null, then check [field2] is not null? Some pseudocode of what I want
    check [field1]
    Is null - error message "Field 1 is null"
    Is not null check [field2]
    Is null - error message "Field 2 is null"
    Is not null - run update query

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    If IsNull(Me!field1) Or IsNull(Me!field2) Then
    MsgBox "Must enter data into both Field1 and Field2"
    Else
    'run UPDATE query
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-11-2013, 12:46 AM
  2. Replies: 10
    Last Post: 10-24-2012, 02:59 PM
  3. How to Check If Two Fields are Null?
    By alpinegroove in forum Programming
    Replies: 5
    Last Post: 01-04-2012, 01:41 PM
  4. Combine two fields, Null fields involved
    By yes sir in forum Access
    Replies: 9
    Last Post: 10-03-2010, 09:20 AM
  5. Replies: 5
    Last Post: 03-20-2010, 08:30 AM

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