Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Posts
    364

    Unanswered: Check box to make text box turn grey on report.

    I have a check box on a form next to 4 fields of addresses (line one, line two, line 3, line 4). When the check box is checked I want the 4 fields of address on a report to turn light grey in their boxes.

    Ive done it so they turn grey on the form, but need it on the report aswell so it can be printed out.

    Is this possibble?
    Last edited by moss2076; 09-16-04 at 05:58.

  2. #2
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    is this just a colour change, or are you making the fields inactive?

  3. #3
    Join Date
    Aug 2004
    Posts
    364
    Just a color change, just so when the checkbox is enabled it makes the reports addresses change color.


  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In the detail section of the report put the next code and make the suitable changes
    Note that Detailbereich = your Detail section

    PHP Code:
    Private Sub Detailbereich_Format(Cancel As IntegerFormatCount As Integer)
         If 
    Forms("yourFormName").yourCheckbuttName.Value True Then    
            Detailbereich
    .BackColor 8453888    'yellow 8454143  'Gray 12632256
         
    Else
           
    Detailbereich.BackColor 16777215
         End 
    If
    End Sub 

  5. #5
    Join Date
    Aug 2004
    Posts
    364

    Unhappy Cant get it to work

    Ive just tried that code, put it in the OnFormat part of the detail section of my report as an event but the debugger says it cant find my form name, even tho it is spelt identically.

    Any ideas where I'm going wrong?

    My form name is - sentence_history_new
    The checkbox in the form is called NFA
    The address box on the report (and form) is - address_1

    The code I entered is -

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Forms("sentence_history_new").NFA.Value = True Then
    Address_1.BackColor = 12632256
    Else
    Address_1.BackColor = 16777215
    End If

    End Sub

    Any ideas why its not working?

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    The form must be opend while you run the Report...

Posting Permissions

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