Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Northern, NJ, New Jersey, USA
    Thanked 0 Times in 0 Posts

    Control Text Box? (2000 (SR1))

    I am looking for a visual effect here - I don't know if this is possible.

    We are creating a checklist for projects in Access. (no one wants to use MS Project). Fields formatted as Yes/No have been used and a form is created to go in and check what you have done. Lets call them [Step1] [Step2] [Step3]

    The boss would like to have a form/report that will display checked items in black and unchecked items in white. I thought 'Conditional Formatting' would be a good idea but if I list all the items on the page in text boxes and select one, Format/Conditional Formatting is not available. Lets call the boxes [Text1] [Text2] [Text3]

    I guess the question is this...
    If [Step1] is true can [text1] then be black?
    There is always a way.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Sint Niklaas, Belgium
    Thanked 0 Times in 0 Posts

    Re: Control Text Box? (2000 (SR1))

    For a report, I don't see aproblem. Put the textboxes in the detail section and set the recordsource to the appropriate yes/no fields.
    Name them as text1, text2, text3
    In the On format event of the detail section of the report, enter the following code:
    <pre>Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim x As Integer
    For x = 1 To 3
    If Me.Controls("text" & x) = -1 Then
    Me.Controls("text" & x).BackColor = vbBlack
    Me.Controls("text" & x).ForeColor = vbBlack
    Me.Controls("text" & x).BackColor = vbWhite
    Me.Controls("text" & x).ForeColor = vbWhite
    End If
    Next x
    End Sub</pre>

    For the form, if you display the form in Single form, you can put similar code in the On Current event.
    If the form is displayed in Continuous form or DataSheet, I'm afraid your boss will have to be satisfied with check boxes because you can't change the format for each individual record.

Posting Permissions

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