Results 1 to 8 of 8
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Msgbox font size

    Is it possible to increase the font size used in Msgbox? I don't see anything in Client Settings.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    I can't just write No as the message would be too short!

    To do this, you have to create your own replacement form
    However you can use the Eval function to make the first section BOLD :

    Click image for larger version. 

Name:	FormattedMagBox.PNG 
Views:	15 
Size:	4.4 KB 
ID:	32519

    If that looks useful, let me know & I'll provide the code needed
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I was reluctant to write my own replacement form simply because, if there's a way to do it, I don't know how to pass back to the point of launching of a popup form the user action. I suppose I could use a global variable to effect such communication but I was hoping there was a way to tell Access to increase the size of the text. And yes, please post the code so I can have a look at what you've done.

    You realize, of course, that "Old Geezers" don't see as well as they used to

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I was curious so did research. Tested in the Immediate window:

    ?Eval("MsgBox ('Test@@test', " & vbOkayOnly & ")")

    Apparently has to use the MsgBox function - MsgBox(), not just the simple MsgBox.

    I have used my own form. Variety of methods available to pass back selected value. Can set a global variable, TempVars, or code populates a textbox on the calling form.
    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.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    The syntax is messy so I use a function to make it simpler to work with
    Place this in a standard module:

    Code:
    Public Function FormattedMsgBox(Prompt As String, Optional Buttons As VbMsgBoxStyle = vbOKOnly, _ 
            Optional title As String = vbNullString, Optional HelpFile As Variant, Optional Context As Variant) As VbMsgBoxResult
    
    On Error GoTo Err_Handler
     
     'Taken from http://www.trigeminal.com/usenet/usenet015.asp
     
        If IsMissing(HelpFile) Or IsMissing(Context) Then
          'NOTE: I NEVER use this section - it could be omitted
            FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
             """, " & Buttons & ", """ & title & """)")
        Else
            FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
             """, " & Buttons & ", """ & title & """, """ & _
             HelpFile & """, " & Context & ")")
        End If
        
        'Examples:
        'section before @@ is in BOLD followed by blank line
        'strPrompt = "Import completed@@" & strPrompt
        'FormattedMsgBox strPrompt, vbInformation + vbOKOnly, "Contact import completed"
        'FormattedMsgBox "Bold text here!@First line normal text.@Second line normal text.",vbOKOnly + vbExclamation, "Box Title"
        
    Exit_Handler:
        Exit Function
    
    Err_Handler:
       'various obscure errors which you may never experience
        If err = 5 Or err = 13 Or err = 94 Or err = 2465 Then Exit Function
        
        strProc = "FormattedMsgBox"
        MsgBox "Error " & err.Number & " in " & strProc & " procedure : " & vbCrLf & "   - " & err.description
        
        Resume Exit_Handler
        
    End Function
    Then in the immediate window type this to get the message box I showed before:

    FormattedMsgBox "Bold text for important text here!" & _
    "@First line normal text. " vbCrLf & _vbCrLf & _
    "Second line normal text. @",vbOKOnly + vbExclamation, "Formatted Message Box Title"

    One other nice thing about it is that you can widen the formatted message box by leaving deliberate spaces at the end of lines.
    That doesn't work in a standard message box

    For customised message boxes (and other ways of getting user's attention), see this example database: https://www.accessforums.net/showthread.php?t=69858
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I have used my own form.
    I'm inclined to write such a form when I can break away from what's currently "on my plate".

    Thank,
    Bill

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks, like I posted to June7, I'll write a popup form to handle most of my situations when I can create some time.
    Bill

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    I forgot to mention that you can of course enlarge message boxes along with every other Windows feature by increasing the scaling from 100% in Windows settings / control panel
    I just tried 175% & the message box was large!
    The maximum is 500%
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. UI Font Size
    By bertsirkin in forum Access
    Replies: 4
    Last Post: 06-23-2017, 07:24 PM
  2. Treeview font size
    By charly.csh in forum Access
    Replies: 7
    Last Post: 03-23-2016, 05:09 PM
  3. MsgBox font size
    By GraeagleBill in forum Programming
    Replies: 4
    Last Post: 01-02-2013, 02:59 PM
  4. Font Size control
    By techexpressinc in forum Forms
    Replies: 2
    Last Post: 06-29-2011, 06:26 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