• Formatting text (A2k2)

    Author
    Topic
    #372896

    Does anyone know how to make part of a text box appear in a different colour.

    I can’t use conditional formatting as it changes all the box at a time. I need to convert only part of the text, and using a separate box does not look good from a design viewpoint.

    I’ve tried Format(“My Text”,”vbred”) and various similar alternatives without success. The help File, as ever seems to have little to say on the subject.

    Taking this a stage further, can text be made to blink/flash?

    Thanks

    Viewing 0 reply threads
    Author
    Replies
    • #597417

      Hi Colin,

      Basically, Access was designed to be a data processor, not a word processor. It doesn’t provide the possibility to format part of a text box. You would need to put an ActiveX RichText control on your form or report for that. The Office Developer Edition comes with such a control, as does Visual Studio 6. There are also third-party RichText controls, for instance from FMS. Handling these controls must be done in code, so it’s a lot of work.

      You might use the OnTimer event of a form to make text blink. I’m not very fond of blinking myself, but here is an example:

      In the Properties of the form, select the Events tab.
      Scroll down to the Timer Interval. Enter the interval in milliseconds. So if you want text to blink every second, enter 1000.
      Next, create code for the On Timer event. In the following, I use a label and switch the text color between white and black. You can adapt it to your own needs:

      Private Sub Form_Timer()
      If lblMyLabel.ForeColor = vbBlack Then
      lblMyLabel.ForeColor = vbWhite
      Else
      lblMyLabel.ForeColor = vbBlack
      End If
      End Sub

      Regards,
      Hans

      • #597426

        Hi Hans,

        Thanks for the advice. I’ll leave red text alone, and simply use Conditional formatting, which highlights an important message that I want seen.

        I’ll try the blinking, although it is annoying, when relevant, it might be important. The message I want to highlight comes up so infrequently, that it will not annoy in regular use.

        Thanks again

        Colin

    Viewing 0 reply threads
    Reply To: Formatting text (A2k2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: