Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

controlling backcolor for records in a report

Discussion in 'Information Technology' started by Warden, Jul 28, 2006.

  1. Warden

    Warden
    Expand Collapse
    Guest

    I have created a report which list work tickets with the date the ticket was
    authorized for work to begin. i have included a check box that indicates if
    the job is complete. I have been asked to change the color of the record in
    the report to futher identify what is complete. for example if job number one
    is complete the text boxes for that job should be gray, if incomplete the
    backcolor it will still be white. i have tried to use the setvalue method
    based on the value of the check box. but this turns out to be all or nothing,
    either all records are grayed out or all white depending on the vaule of the
    check box.
    what is the best way to do this on each individual record?
    here is a sample of the code:

    With CodeContextObject
    If (.ckbxComp = -1) Then
    Reports![E07 Auth FMR/Drawing Check List]!jobsummary.BackColor =
    255
    End If
    If (Not .ckbxComp = -1) Then
    Reports![E07 Auth FMR/Drawing Check List]!jobsummary.BackColor =
    16777215
    End If
    End With
     
  2. Loading...

    Similar Threads Forum Date
    General Controlling Kaam (Lust) Hard Talk Apr 8, 2014
    Money and Controlling Spending Questions and Answers Nov 18, 2011
    USA Anti-Islam pastor called controlling, "mad" Breaking News Sep 13, 2010
    Opinion Manmohan Singh Phenomenon: India's Grand Strategy of Controlling the Thought of Sikhs Breaking News Jul 8, 2010
    Technique Of Controlling Mind Gurmat Vichaar Jan 27, 2008

  3. Larry Linson

    Larry Linson
    Expand Collapse
    Guest

    "Warden" <Warden@discussions.microsoft.com> wrote

    > I have created a report which list work
    > tickets with the date the ticket was
    > authorized for work to begin. i have
    > included a check box that indicates if
    > the job is complete. I have been asked
    > to change the color of the record in
    > the report to futher identify what is
    > complete. for example if job number one
    > is complete the text boxes for that job
    > should be gray, if incomplete the
    > backcolor it will still be white.


    It's not at all clear to me what your code was trying to do nor where you
    located it, so I have opted to start over rather than offer comments on your
    code.

    Unlike Forms, Reports do not carry "unused" fields in the recordset they
    generate from their RecordSource at execution. So you will need to place a
    Control on your Report that has a Control Source of your Yes/No Field. Set
    its Visible Property to "No" if you don't want it to be displayed. Then, in
    the OnPrint event of the Detail Section, you can use code similar to this

    If Me.BackcolorGrey = True Then
    Me.Detail.BackColor = 12632256
    Else
    Me.Detail.BackColor = 16777215
    End If

    Note that I named my Yes/No field as BackColorGrey for example purposes, so
    you will need to replace that with the name of your Field. I referred to the
    Field itself, rather than the Control, but could have used

    If Me!chkBackcolorGrey = True Then

    to refer to the value of the (invisible) Checkbox in which I displayed the
    Field.

    Larry Linson
    Microsoft Access MVP
     

Share This Page