Tab in RTF control (2 Viewers)

RonPaii

New member
Local time
Today, 17:56
Joined
Jul 16, 2025
Messages
9
I am displaying static text in an un-bound RTF control on a message box form. Is there anyway to imbed tabs in that text built up with VPN?
 
Not sure, have you tried Chr(9) or ChrW(9)? Just thinking out loud...
 
I have tried the following.
"Invoice amount:" & vbTab & amount No space between : and the amount
"Invoice amount:\Tab" & amount Output: Invoice amount:\Tab followed by the amount.

I am trying to lineup multiple amounts for the invoice, total, paid, due etc. in an information dialog box. I have been using spacing, but it never looks quite right unless I use a fixed with font.
 
Should "VPN" be "VBA"?

RTF is formatted with HTML tags. There is no TAB tag.
Why is textbox RTF? What formatting do you want?
Exactly what do you mean by "dialog box"?

As far as I can determine, vbTab works for building string to display in MsgBox or InputBox.

I have used listbox for display of data.
 
Last edited:
I have an input box function that takes the same input as the built-in function. The function controls my input box form opened as a dialog box. The function also takes optional parameters allowing control of the button text, the addition of a 3rd button and formatting the input for Text, RTF, Long or Double. The prompt control is RTF to allow for better formatting of the prompt.

Another reason I don't use the built-in input box is that I found that the scroll mouse code I use still functions when the input box is open allowing the record on the form under the curser to change. The same issue with the built-in message box.
 
When I get home from holiday if nobody has mentioned how to do it by then I'll post how to disable mousescroll.

In passing this is yet another example of MS removing functionality - the old RTF add-in actually used RTF and not HTML.
 
I enable wheel mouse using a variation of Allen Brown's DoWheelMouse function. Most of my users want some wheel mouse functionality for scrolling records on continuous forms. I think the only way to get tabbing of text in the prompt, is to use the Edge control to display as HTML instead of RTF. The following is the function, called by the on mouse wheel event.

Code:
On_Mouse_Wheel: Call DoWheelMouse(Me, Count)

Const sc_ACCESSFORMVIEW as long = 1

'-----------------------------------------------
'Purpose:   Make the MouseWheel scroll in Form View in Access 2007 and later.
'           This code lets Access 2007 behave like older versions.
'Return:    1 if moved forward a record, -1 if moved back a record, 0 if not moved.
'Author:    Allen Browne, February 2007.
'Usage:     In the MouseWheel event procedure of the form:
'               Call DoMouseWheel(Me, Count)
'
Public Function DoWheelMouse(ByVal Frm As Form, _
                             ByVal lngCount As Long) As Integer
    On Error GoTo Err_Handler
        ' Run this only in Access 2007 and later,
        ' and only in Form view.
        If (Val(SysCmd(acSysCmdAccessVer)) >= 12#) _
       And (Frm.CurrentView = sc_ACCESSFORMVIEW) _
       And (lngCount <> 0&) Then
            ' Save any edits
            ' before moving record.
            If Frm.Dirty Then
                Frm.Dirty = False
            End If
            ' Move back a record if Count is negative,
            ' otherwise forward.
            RunCommand IIf(lngCount < 0&, _
                           acCmdRecordsGoToPrevious, _
                           acCmdRecordsGoToNext)
            DoWheelMouse = Sgn(lngCount)
        End If
Exit_Handler:
    Exit Function
Err_Handler:
    Select Case Err.Number
        Case 2046&
            'Can't move before first, after last, etc.
            Beep

        Case 3314&, 2101&, 2115&
            'Can't save the current record.
            MsgBox "Cannot scroll to another record, " & _
                   "as this one can't be saved.", _
                   VbMsgBoxStyle.vbOKOnly, _
                   "Cannot scroll"

        Case Else
            MsgBox "Error " & Err.Number & _
                   ": " & Err.Description, _
                   VbMsgBoxStyle.vbOKOnly, _
                   "Cannot scroll"
    End Select
    Resume Exit_Handler
End Function
 
I am trying to lineup multiple amounts for the invoice, total, paid, due etc. in an information dialog box. I have been using spacing, but it never looks quite right unless I use a fixed with font.
If your data is displayed vertically i.e.

account 1234
date 1/1/25
etc

Use a continous subform to show the number of columns required and populate accordingly perhaps use an ADO disconnected recordset - you can then left justify the 'headers' control and right justify the values control. You could use a listbox (with a value list) but you cannot format individual columns and not possible (so far as I am aware) to hide the column separator.

otherwise use a continuous form - message in the header and/or footer. If you don't have data to show, you can hide the detail section
 

Users who are viewing this thread

Back
Top Bottom