Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Eval MsgBox

110 views
Skip to first unread message

chrisa...@gmail.com

unread,
Mar 6, 2013, 9:07:42 PM3/6/13
to
I am updating a Access 97 database to 2010. I was distressed to discover that 2010 doesn't have the ability to natively bold the first line of a msgbox as in MsgBox "First Line in Bold@@Second line in plain". The work around for this is to use Eval("MsgBox('First Line in Bold@@Second line in plain')").

Unfortunately using Eval renders the msgbox text bitmapped and rather ugly. I can't find any settings to fix this, has anyone any ideas to get the anti aliasing back?

Many Thanks

Chris

Phil

unread,
Mar 7, 2013, 5:36:25 PM3/7/13
to
On 07/03/2013 02:07:43, wrote:
> I am updating a Access 97 database to 2010. I was distressed to discover
> th at 2010 doesn't have the ability to natively bold the first line of a
> msgbo x as in MsgBox "First Line in Bold@@Second line in plain". The work
> around for this is to use Eval("MsgBox('First Line in Bold@@Second line in
> plain') ").
>
> Unfortunately using Eval renders the msgbox text bitmapped and rather
> ugly. I can't find any settings to fix this, has anyone any ideas to get
> the ant i aliasing back?
>
> Many Thanks
>
> Chris
>

Not original, but this appears to work, and not "Bitty"

Public Function fMsgBox(Prompt As String, Optional Buttons As Integer =
vbOKOnly, _ Optional Title As Variant, Optional HelpFile As Variant, Optional
Context As Variant) As Integer

On Error Resume Next

Dim strMsgBox As String

strMsgBox = "Msgbox(" & Chr(34) & Prompt & Chr(34) & "," & Buttons

If IsMissing(Title) = False Then
strMsgBox = strMsgBox & "," & Chr(34) & Title & Chr(34)
Else
strMsgBox trMsgBox = strMsgBox & "," & Chr(34) & GetOption("Project Name") &
Chr(34) End If

If IsMissing(HelpFile) = False Then
strMsgBox = strMsgBox & "," & Chr(34) & HelpFile & Chr(34)
End If

If IsMissing(Context) = False Then
strMsgBox = strMsgBox & "," & Context
End If

strMsgBox = strMsgBox & ")"

fMsgBox = Eval(strMsgBox)

End Function

Private Sub MsgboxTest_Click()

fMsgBox Box "This is bold.@@This is not bold.", vbQuestion + vbYesNo, "Box
Title"

End Sub

Phil

Douglas J Steele

unread,
Mar 7, 2013, 10:28:22 PM3/7/13
to
Consider having your own form instead of the built-in message box.

wrote in message
news:187e0a17-f6c9-4459...@googlegroups.com...
0 new messages