Results 1 to 2 of 2
  1. #1
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128

    conditional formatting on option box


    I have a continuous form. On which I have a frame and three option boxes with values 1, 2 and 3 what I am trying to do if one record is selected in option box other text boxes of the same record turn red I am using this code which works perfectly expect that it's doing for all records. I want that particular record to turn red.


    Code:
    Private Sub Form_current()
    FormatGroup
    End Sub
    '
    Private Sub Frame53_Click()
    FormatGroup
    End Sub
    Sub FormatGroup()
     Select Case Frame53
     Case 1
     OrderNumber1.BackColor = vbRed
     ProductName1.BackColor = vbRed
     VNumber1.BackColor = vbRed
     Case 2
     OrderNumber1.BackColor = vbYellow
     ProductName1.BackColor = vbYellow
     VNumber1.BackColor = vbYellow
     Case 3
     OrderNumber1.BackColor = vbGreen
     ProductName1.BackColor = vbGreen
     VNumber1.BackColor = vbGreen
    ' Case Else
    ' grpBooked.BackColor = vbYellow
     End Select
     End Sub

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The issue is that you are using a continuous form. The form does not know how to distinguish a control from one record to the same control on another record. Although the control displays different data from the various records of the recordset, it is the same control and the Properties of any given control will be the same for each record displayed.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Conditional formatting
    By keiath in forum Forms
    Replies: 28
    Last Post: 01-27-2014, 08:36 AM
  2. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  3. Conditional Formatting
    By Paul H in forum Reports
    Replies: 3
    Last Post: 11-07-2011, 11:59 AM
  4. Conditional Formatting
    By Desstro in forum Programming
    Replies: 3
    Last Post: 12-01-2010, 09:52 PM
  5. Conditional formatting
    By ylivne in forum Reports
    Replies: 1
    Last Post: 07-12-2009, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums