Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Message Box Font

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom Ventouris - 20 Jan 2008 08:17 GMT
A2007.
Is there a way to change the size of the font on a message box?
I am looking for an alternative to creating a popup form for each message.
Thanks in advance for any help
Allen Browne - 20 Jan 2008 08:35 GMT
A custom popup form for each message?
Just create one form, and use it for all messages.

Pass the message in (say) OpenArgs, and in Form_Open assign it to the
unbound text box (or label Caption) to display the message.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> A2007.
> Is there a way to change the size of the font on a message box?
> I am looking for an alternative to creating a popup form for each message.
> Thanks in advance for any help
Tom Ventouris - 20 Jan 2008 08:52 GMT
Thank you. A good suggestion which will take care of some messages, but many
have options for the users, (Yes, No, Ok, Cancel)
I am thinking of passing some value to a hidden field on the form and coding
the buttons to execute action depending on the hidden field value,
but this sounds like too much coding.

As a final option, I am buying the client reading glasses Monday morning. :)

Your reply was withdrawn(?) from my newsreader. I can see it on the group
site but cannot log on to reply.
Replying via newsreader, I hope it lands in the right place.

> A2007.
> Is there a way to change the size of the font on a message box?
> I am looking for an alternative to creating a popup form for each message.
> Thanks in advance for any help
Arvin Meyer [MVP] - 20 Jan 2008 10:49 GMT
Here is a sample form that can also run functions, and replace all the
functionality of a MsgBox, while still allowing you to change font's font
color, size and position:

http://www.datastrat.com/Download/MsgBox2K.zip
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Thank you. A good suggestion which will take care of some messages, but
> many have options for the users, (Yes, No, Ok, Cancel)
[quoted text clipped - 14 lines]
>> message.
>> Thanks in advance for any help
Tom Ventouris - 20 Jan 2008 12:37 GMT
Thanks Arvin
I also need Yes/No options for this one.
Your sample will help elsewhere.

> Here is a sample form that can also run functions, and replace all the
> functionality of a MsgBox, while still allowing you to change font's font
[quoted text clipped - 19 lines]
>>> message.
>>> Thanks in advance for any help
Allen Browne - 20 Jan 2008 11:05 GMT
Tom, it's not actually that hard to get this kind of form going.

You create a form with a text box (txtMsg), 4 command buttons (cmd1, cmd2,
cmd3, cmd4), and possibly 4 image controls (for critical, exclamation,
information, and question.) Set the form's properties, for popup and modal.

Create a function that opens the dialog, passing the information in
OpenArgs, like this:
   docmd.OpenForm "fdlgMsgBox", WindowMode:=acDialog, _
       OpenArgs:="Hello message, vbOk, My caption"

Then in the Open event of the form, parse OpenArgs into an array, and handle
each component. This kind of thing:

Private Sub Form_Open(Cancel As Integer)
   Dim varArray As Variant
   Dim iUbound As Integer
   Dim lngMsgBoxStyle As Long

   varArray = Split(Me.OpenArgs, ",")
   If IsArray(varArray) Then
       If iUbound >= 0 Then
           If varArray(0) <> vbNullString Then
               Me.txtMsg = varArray(0)
           End If
           If iUbound >= 1 Then
               If IsNumeric(varArray(1)) Then
                   lngMsgBoxStyle = varArray(1)
                   'Figure out your buttons/image
                   Select Case (lngMsgBoxStyle And vbOK)
                       Case vbOK
                           With Me.cmd1
                               .Visible = True
                               .Caption = Ok
                           End With
                       Case vbOKCancel
                           With Me.cmd1
                               .Visible = True
                               .Caption = Ok
                           End With
                           With Me.cmd2
                               .Visible = True
                               .Caption = Cancel
                           End With
                       'etc
                       End Select
                   End If
               End If
               If iUbound >= 2 Then
                   If varArray(2) <> vbNullString Then
                       Me.Caption = varArray(2)
                   End If
               End If
           End If
       End If
   End If
End Sub

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Thank you. A good suggestion which will take care of some messages, but
> many have options for the users, (Yes, No, Ok, Cancel)
[quoted text clipped - 14 lines]
>> message.
>> Thanks in advance for any help
Tom Ventouris - 20 Jan 2008 12:38 GMT
Thank you Allen.
It's not that hard any more. Thanks for an excellent start.
I'm done.

> Tom, it's not actually that hard to get this kind of form going.
>
[quoted text clipped - 73 lines]
>>> message.
>>> Thanks in advance for any help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.