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

    custom error message

    i have table primary_tbl:


    groupID autonumber
    fullname short text

    ive set fullname field to 'required'.

    in a form, i want a custom error message when error occurs because i haven't set my fullname for the record.

    how do i set a custom error message like "please set fullname"? thx

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In the BeforeUpdate event of the form, check the field and if it is null or blank then give an error message and set cancel=true.

  3. #3
    gwboolean is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    65
    Personally, I like using one of two approaches to messages. For any type of exception I generally will setup a try/catch and in the catch part I will use a message box that carries a message indicating the error, where it occurred and possible solutions. I keep the messages in a namespace that I have setup just for those and call the message from the message box. For something like what you describe I prefer to just have a label with .visible = false and .text = "whatever message needed". For your case I would setup a if branch in the event to make the label.visible = true.

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

Similar Threads

  1. Replies: 7
    Last Post: 03-17-2016, 05:53 PM
  2. Replies: 5
    Last Post: 05-15-2015, 10:49 AM
  3. Replies: 15
    Last Post: 11-01-2013, 03:24 PM
  4. custom error message
    By msasan1367 in forum Access
    Replies: 1
    Last Post: 04-27-2013, 09:14 AM
  5. Replies: 14
    Last Post: 06-06-2012, 12:50 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