Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008

    Question Unanswered: changing backcolor of text in report based on outcome.

    Access 2003

    I have a Form that has a combo box that has a choice of a "blank" choice and a few other text sentences choices.

    I run a report that displays the text box and the selected info that was chossen from the combo box from the form. The report works great.

    What I would like to do is : on the report, if one of the choices from the combo box is "Extra Markdown", I would like the background to be yellow on the report, otherwise to be the default white.

    I tried different ways to get it to work,,,, but I can't

    Please help


  2. #2
    Join Date
    Jun 2007
    Maitland NSW,Australia
    on the Detail_print event of your report you will need something like this

    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

    If Me!selected_Choice="Extra Markdown" then
    Me!selected_Choice.BackColor = vbYellow
    Me!selected_Choice.BackColor= vbWhite
    End If

    End Sub

    where Me!selected_Choice is text box on the report that displays the selected info that was chosen from the combo box from the form.

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    although personally I prefer to do this in code (seemingly as does PoppaSmurf)... you could also try conditional formatting (which I loathe with a passion)
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts