Results 1 to 7 of 7
  1. #1
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12

    How to change an SQL pop up message

    I set one of the fields to not allow nulls and it is working. Click image for larger version. 
<br /><script async src=
    Name: SQL pop up.jpg  Views: 17  Size: 25.7 KB  ID: 52432" class="thumbnail" style="float:CONFIG" />

    Can this message be customized?

    Thanks,

    J.R.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Not change but possibly trap error message and deliver your own with VBA.

    How are you executing the SQL? Why not prevent event causing error?
    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
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    If what you really want is a customized message then you need to trap that error number in the afterupdate event of the control. Then you'd present either a message box with your custom message, or your own form that looks like a message box.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,175
    Maybe better in the BeforeUpdate event, so you can prevent the error. Or simply set the validation rule not null in the form control?

  5. #5
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    Quote Originally Posted by Micron View Post
    If what you really want is a customized message then you need to trap that error number in the afterupdate event of the control. Then you'd present either a message box with your custom message, or your own form that looks like a message box.
    I'll try this first.

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,144
    Just to clarify - I'm pretty certain Access can't capture that error as it is returned by the ODBC driver.
    Any Table level constraint must be validated in the forms before update event so that it doesn't actually trigger the table constraint.

    It's one of the few downsides to setting table level constraints on SQL server.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,175
    In fact, in most companies the developers are briefed about existing constraints and structures on the database, and it is company policy that all restrictions are met in the front end before any commands are send to the database. If an error is returned from the database it is seen as a bug in the front end.

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

Similar Threads

  1. Replies: 2
    Last Post: 09-19-2017, 11:31 AM
  2. message pop up for users when database opens
    By ecalvert47462 in forum Access
    Replies: 8
    Last Post: 10-18-2012, 11:39 AM
  3. Replies: 9
    Last Post: 09-26-2012, 12:20 PM
  4. POP UP Message - validation test
    By akhlaq768 in forum Forms
    Replies: 1
    Last Post: 02-22-2012, 05:03 AM
  5. Can not close pop up form after second pop was opened
    By snoopy2003 in forum Programming
    Replies: 2
    Last Post: 03-09-2011, 02:56 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