Results 1 to 4 of 4
  1. #1
    gunitinug is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2017
    Posts
    23

    submit form event to check for null field

    Click image for larger version. 
<br /><script async src=
    Name: which event.jpg  Views: 14  Size: 79.7 KB  ID: 30319" class="thumbnail" style="float:CONFIG" />


    How to make event so that when form is submitted it checks if verify field is not null and if it is then won't allow submission but give a custom error message?

    thx

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    gunitinug is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2017
    Posts
    23
    i used

    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
        If (IsNull([verify])) Then
            MsgBox ("test...")
            Cancel=true
        End If
    End Sub
    only works when i have clicked on verify textbox and edited it first... Have to add condition to check that field on form has not been set. how to do this?

    this happens with 'pre-existing' records so setting default value to null for verify textbox dont help for older records... null is inserted for new records

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That should work for new records or if a record is edited. You can check in the current event if the record being displayed needs that field filled out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 06-30-2017, 10:56 AM
  2. Replies: 3
    Last Post: 12-10-2015, 03:51 PM
  3. Replies: 3
    Last Post: 05-30-2014, 11:18 AM
  4. OnClick Event submit and clear
    By Desstro in forum Forms
    Replies: 1
    Last Post: 01-12-2011, 09:42 AM
  5. Replies: 0
    Last Post: 01-08-2009, 05:49 PM

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