Share via

Conditional Formatting in a Continuous form

Anonymous
2012-03-02T02:18:36+00:00

Form name:     frmMissedMeds

It is a continuous form.

When many records are displayed any conditional formatting of the control influences that control on all  the records on the form. So I tried to accomplish it by entering the code (copy displayed below). The result is the same. Is there anyway to by pass the problem and keep the form property still 'Continuous'?

     If Me.Epogen > 0 Then

        If Me.EpoGiven = 0 Then

            Me.Epogen.BackColor = vbBlue

            Me.Epogen.ForeColor = vbRed

        End If

    End If

[Epogen] is a number

[EpoGiven] is a text box

Thanks

Sincerely

HNIM2010

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-03-04T03:05:15+00:00

Marshall, Dan and Hans

This is embarrassing. I made a mistake. All the controls on the form have the same name as the corresponding data source field name in the table...Except the EpogenGiven. It is named as EpoGiven. Once I corrected that everything is working fine.

Apologize for wasting all of your time. I promise I will be more careful in the future.

Sincerely

HNIM2010

Was this answer helpful?

0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-03-03T15:03:17+00:00

    Was this answer helpful?

    0 comments No comments
  2. HansV 462.6K Reputation points
    2012-03-03T09:24:24+00:00

    Could you make a copy of the database, strip away everything that isn't relevant to the problem, as well as all sensitive information, then zip this copy and make it available through one of the websites that let you upload and share a file, such as Windows Live SkyDrive (https://skydrive.live.com) or DropBox (http://www.dropbox.com)? Post a link to the uploaded file in a reply here.

    Or post a question in the Access forum at www.eileenslounge.com where you recently registered as a member. You can attach files up to 250 KB to a post there.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-03-03T04:28:24+00:00

    I have tried that all ready and the result is the same. Even if there is on records that needs to be highlighted with blue background the same control in all the records on that continuous form get highlighted. Has any body tried the conditional format on a continuous form in Access2010 and did they experience the same result? If the answer is different from my experience and after the problems I had with the DLookup on my previous post that you are familiar with...I am wondering whether my Access Program is badly corrupted and whether I should reinstall it again !!

    Also, although the control on this form is on the same record the data source for the two controls are from two different tables obtained through a query. Not sure whether that has anything do with as to how the Access goes about Conditional formatting!

    Thanks

    HNIM2010

    Was this answer helpful?

    0 comments No comments
  4. HansV 462.6K Reputation points
    2012-03-02T11:52:05+00:00

    Code won't work here - a continuous form has a single set of controls. If you change the BackColor or ForeColor of a control, it will affect all displayed records.

    However, Conditional Formatting should work.

    Open the form in design view.

    Select Epogen.

    Click Conditional Formatting on the Format tab of the ribbon.

    Click New Rule.

    Select Expression Is from the first dropdown.

    Enter the following expression in the box next to the dropdown:

    [Epogen]>0 And [EpoGiven]=0

    Specify blue as back color and red as text color.

    Click OK twice.

    Was this answer helpful?

    0 comments No comments