Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2014
    Posts
    2

    Unanswered: Can I set the property of a control in a continuous form?

    Version: Access 2003

    I have a continuous form based on a table and I want to change the border color of one of the fields in each of the records based on another field in that record. What I am doing is not working.

    Here is what I want:

    FORM

    column1 | column2
    Y 5 {border color red}
    Y 2 {border color red}
    X 6 {border color black}
    Y 1 {border color red}

    So for every record showing on the continuous form I want a border color of red around the value in column2 when column1 has a value of "Y".

    Here is what I am getting:
    All my records displaying on the continuous form are showing only what is based in the first record. So if the first record has the above ("Y") the border color is red for all the records on the screen.

    Here is my code:
    I wrote this code in the open of the form. I know that it does loop the number of times for each record in the continuous form but Me![SelectedStyle] always equals to whats in the first record. Also even if it would change it only uses what was set the last time in Me!LengthsHalfText.BorderColor. Its almost like this code loops, everything is set and THEN the form displays the border setting to all the records.

    Private Sub Form_Open(Cancel As Integer)

    With Me.RecordsetClone

    Do Until .EOF

    If Me![SelectedStyle] = "Y" Then
    Me!LengthsHalfText.BorderColor = RGB(255, 0, 0)
    Else
    Me!LengthsHalfText.BorderColor = RGB(0, 0, 0)
    End If

    .MoveNext
    Loop

    End With

    End Sub

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    use conditional formatting in place. when using continuous forms, setrtign a controls properties affects the same control for all rows
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jul 2014
    Posts
    2
    Quote Originally Posted by healdem View Post
    use conditional formatting in place. when using continuous forms, setrtign a controls properties affects the same control for all rows
    Thanks healdem. But all I see for conditional formatting for 2003 is bold, italics, underline, font color and background color. If I have border color as an option somewhere I would love to know.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you want to change the colour of something in continuous forms then your choices are limited/. I seem to remember that some people have a workaround that may meet your requirements. if you search through the forum you may strike lucky. the advanbed search may be able to help you.
    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
  •