Results 1 to 4 of 4
  1. #1
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169

    Customize Message Box On Command

    I have very little experience with messaging in Access. I have code written that will change the status of a record from Active to Inactive when the user clicks on the command button on the form. The user will think they are deleting the record as they will be taken away from the form when they click on the button but will really only be updating the status indicator. Because I am using an UPDATE command, the standard Access message box that pops up is:



    "You are about to update 1 row(s)"
    "Once you click Yes, you can't use the Undo command to reverse the changes."
    "Are you sure you want to update these records?"

    and then it gives the options to click on YES or NO.

    How can I change this error message so that it says something like:
    "You are about to delete this record...blah, blah, blah"
    "Are you sure you want to delete this record?"

    and then present the YES or No option buttons?

    Thanks much!

  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,521
    Use a Yes/No message box, with If/Then code; if Yes then execute your SQL, either using SetWarnings before and after or using CurrentDb.Execute instead of RunSQL. More info on all in VBA help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you can create your own form that serves as a universal message box. that's what I do. if the message is an action query warning from the program itself, you can either turn the messages off in the options or use the currentdb().execute command instead of using docmd.runsql

  4. #4
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169
    Thanks Adam and Paul. I will give this a shot.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  2. Message box issues.
    By thart21 in forum Programming
    Replies: 2
    Last Post: 05-29-2010, 12:58 AM
  3. error message
    By ngeng4 in forum Forms
    Replies: 85
    Last Post: 03-25-2010, 06:47 AM
  4. message box help
    By shaz10010 in forum Forms
    Replies: 1
    Last Post: 04-17-2009, 09:11 AM
  5. If / Then Error Message
    By Schwagr in forum Forms
    Replies: 4
    Last Post: 03-30-2006, 06:28 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