Formatted text in Msgbox

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

Hi,

I have below:

Ans = MsgBox("Access detect " & rst.RecordCount & " records from your last
work." & vbCr & vbLf & vbCr & vbLf & "To continue with your last work, click
Yes" & vbCr & vbLf & "to start new session click No", vbYesNo +
vbInformation)

How can I put the first line to bold?

SF
 
SF said:
Hi,

I have below:

Ans = MsgBox("Access detect " & rst.RecordCount & " records from your
last work." & vbCr & vbLf & vbCr & vbLf & "To continue with your last
work, click Yes" & vbCr & vbLf & "to start new session click No",
vbYesNo + vbInformation)

How can I put the first line to bold?

SF

If you're using Access 97, you can write this:

Ans = MsgBox( _
"Access detect " & rst.RecordCount & _
" records from your last work.@" & _
"To continue with your last work, click Yes" & vbCr & _
"to start new session click No@", _
vbYesNo + vbInformation)

If you're using Access 200 or later, you have to do it like this:

Ans = Eval( _
"MsgBox(""Access detect " & rst.RecordCount & _
" records from your last work.@" & _
"To continue with your last work, click Yes" & _
vbCr & "to start new session click No@"", " & _
vbYesNo + vbInformation & ")")

You have to wrap the call to the MsgBox function in an Eval() to get the
old formatting functionality.
 
Back
Top