jcheah
09-09-2003, 12:27 AM
I am trying to create a MESSAGE BOX that displays data in a table format.
i am currently using vbcrlf and vbtab but the table becomes distorted when different numbers are entered. eg.
Car Km Hp
abc 100 200
def 200 190
ghi 30000 250
any suggestions?
jc
zak2zak
09-09-2003, 01:17 AM
May be this helps....
Private Function AddSpace(sText As String, intSpace As Integer)
'intSpace variables can be customized to the max len of u'r data
If Len(sText) < intSpace Then
sText = sText & Space(intSpace - Len(sText))
End If
AddSpace = sText
End Function
'TO CALL
Dim Msg As String
Msg = Msg & rs![Car] & vbTab & AddSpace(rs![Km], 6) & vbTab & rs![Hp] & vbCr
MsgBox Msg
SpaceFrog
09-09-2003, 01:26 AM
Only if you use constant size space font such as courrier new for example...
jcheah
09-09-2003, 01:36 AM
Only if you use constant size space font such as courrier new for example...
how do i change the font?
thanks =)
jc
SpaceFrog
09-09-2003, 01:56 AM
Font is windows parametered font, you have to change it in personal parameters.
It would be simpler to crate your own message box with a frame if only needed on one form or with a form if needed all over program...