Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2019
    Posts
    20

    Two data validation dialog boxes appearing

    I have data validation set up for multiple controls on a form. When a validation error is triggered, two dialog boxes pop up. The first is my custom message,



    Click image for larger version. 

Name:	Custom DV Message.JPG 
Views:	15 
Size:	18.3 KB 
ID:	39349

    and the second is a generic message.

    Click image for larger version. 

Name:	Second DV Message.JPG 
Views:	14 
Size:	30.9 KB 
ID:	39350

    What is causing the second dialog box?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Post your code.

    Your message comes from ValidationText property?
    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.

  3. #3
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Hmm, first one comes from the Table, the second one looks to be coming from the Form. Perhaps this will help...
    https://www.access-programmers.co.uk...d.php?t=190243

  4. #4
    Join Date
    Jun 2019
    Posts
    20
    Quote Originally Posted by June7 View Post
    Post your code.

    Your message comes from ValidationText property?
    I'm using the control's properties to enter the validation:
    Click image for larger version. 

Name:	ValidationSettings.JPG 
Views:	11 
Size:	14.5 KB 
ID:	39352

  5. #5
    Join Date
    Jun 2019
    Posts
    20
    Quote Originally Posted by GinaWhipp View Post
    Hmm, first one comes from the Table, the second one looks to be coming from the Form. Perhaps this will help...
    https://www.access-programmers.co.uk...d.php?t=190243
    Is it necessary to use code for this? If data validation is a built-in feature, it seems odd that code would be needed to make it work properly - unless it's a bug that Microsoft hasn't fixed.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What are you doing when these messages pop up?

    I would say first one is from form control and not sure where second is from.

    It would appear that somehow user is getting out of that control in spite of the validation violation and then record attempts to commit triggering second message.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  7. #7
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    It's not necessary, as I said I like a bit more control then what is built in. Also, the built in is a little harder to navigate when upsizing to an SQL Server. I was simply offering a choice.

  8. #8
    Join Date
    Jun 2019
    Posts
    20
    I removed the validation from the form controls and added them to the table, and the second message stopped appearing. Weird. I guess moving forward I will use tables for validation rather than forms.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Your code is on a BeforeUpdate event and it presents that message? Then I suspect you do not cancel the update; rather you just exit the sub. Sometimes the answer is to trap a built in error message because it can't be stopped otherwise.
    Is it necessary to use code for this? If data validation is a built-in feature, it seems odd that code would be needed to make it work properly
    Code is not usually required if you place validation at the table level AND include a validation message that makes sense. Often the default message is less than perfect. Code validation is much more powerful, so don't dismiss it out of hand.
    Last edited by Micron; 08-07-2019 at 06:21 PM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 10
    Last Post: 12-05-2017, 10:21 AM
  2. Dialog Boxes Pop Up When Running Report
    By elhale in forum Reports
    Replies: 4
    Last Post: 03-14-2017, 11:34 AM
  3. Data not appearing now in form
    By Waterdog in forum Forms
    Replies: 13
    Last Post: 08-28-2015, 12:57 PM
  4. Data not appearing on the table in Access 2007
    By Nashskye13 in forum Access
    Replies: 2
    Last Post: 10-26-2012, 02:41 PM
  5. Replies: 1
    Last Post: 09-05-2012, 01:36 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