Align Text in Message Box

ctr1085

Registered User.
Local time
Yesterday, 20:06
Joined
Jul 7, 2006
Messages
26
Does anyone know if there is a way to align text in a message box? I have a number of categories I want to display with the values and I want everything to line up.

I want the ":" to line up on each category

EX.
Statement_ID: 312030
Parent: ABC
Statement_Amount: $50,000.00
 
I guess that the text before the colon is just that, background text. If that's the case you can use the following:
msgbox " Statement ID: " & me![IDControlName] & vbcr & _
" Parent: " & me![ParentControlName] & vbcr & _
" Statement Amount: " & me![AmountControlName]
However you will have to edit the number of spaces a few times until the display is the way you want it because message boxes don't quite handle spaces the way you expect.
As an alternative try using a form with the pop-up property set to "yes" to display the values, the layout of them is much more flexible and easier to control. If you have problems passing the information from the main form to the pop-up form define global variables in a module, update them from the event procedure that opens the pop-up form (where you'd put the msgbox call) before you open the pop-up and update the variables in the pop-up from the global variables in the onCurrent or onOpen proceure of the pop-up.
Hope this helps
 
Thanks for the reply. After searching everywhere and trying to add spaces I have found that message boxes are not very good when it comes to formatting. a pop-up message form is the easiest way to solve my issues. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom