Change Msgbox Button Text

Posted on 2004-11-20
Last Modified: 2008-03-10
Hello experts, rookie here.
I use msgboxs throughout my app. and the defaults are normally fine. I have one were instead of saying "Yes" "No", I would like to say "Now" "Later". This is my standard setup for a msgbox.

Dim Cancel As Integer
Dim strMessage, Title As String
Dim intOptions As Integer
Dim bytChoice As Byte
strMessage = "Do it Now or Later?"
Title = "Process Assignments"
intOptions = vbQuestion + vbYesNo + vbDefaultButton2
bytChoice = MsgBox(strMessage, intOptions, Title)
     If bytChoice = vbNo Then
          Cancel = True  
                     'Do the function

Is there a fairly easy way to do this? I keep finding very large/complex msgbox threads were you can change button location and everything else. Unfortunately I can not seem to get thru the mountains of code to find the parts that would just let me do this.

Question by:JimK31
    LVL 119

    Assisted Solution

    by:Rey Obrero
    You can not change the default msgbox.
    If you want a customize one, you have to create your own  form and make it look like a msgbox
    LVL 58

    Accepted Solution

    Point is: you can, but only using rather complex system-level WinAPI calls. It is not worth the trouble.
    Follow capricorn's advice: it's easier and more fun that way!
    LVL 58

    Expert Comment

    BTW: if you need advice on how to create the form, feel free to ask ;)
    LVL 48

    Assisted Solution

    by:Ryan Chong
    Worth to try below? Which method is faster? 8-)

    Try customize this:

    Modifying a Message Box with SetWindowsHookEx

    Hope this helps

    Author Comment

    Thanks everyone. Not what I wanted to hear, but at least I know I wasn't missing something. I have long since gotten away from form messages as I don't really like them, but in this case since it is only one, it looks like the best choice. The messagebox hook stuff I have read before and is just beyond my ability to hack. Or maybe better said, just to much code for so little a change. I'm splitting the points for the effort.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Title # Comments Views Activity
    MsgBox 2 28
    Show Balance 3 15
    Day count current month 3 23
    Passing a TempVar to a Combo box form 3 23
    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now