Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    May 2003
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    what's wrong with this? (Acees 97)

    Hi all
    Could you please correct my code below. On a form I have a checkbox 'Reconc' and its Label 'Label59' all I want is when checked it should show in black otherwise red.I'm using WNT and Access 97

    Private Sub Form_Load()
    If Reconc.Value <> Checked Then
    Label59.ForeColor = vbRed
    Else
    Label59.ForeColor = vbBlack
    End If
    End Sub

    Thankyou

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: what's wrong with this? (Acees 97)

    The value of a check box is True or False (or Null, if it hasn't been set/cleared yet); Checked is not a valid value. So try True instead of Checked.

  3. #3
    New Lounger
    Join Date
    May 2003
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: what's wrong with this? (Acees 97)

    Thanyou for your reply.
    I've just tried that, it does the same thing as cheched but the problem is : the label shows only in red as I go through records for both checked and uncheked box 'It doesn't change to black when unchecked "
    tks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: what's wrong with this? (Acees 97)

    The code you have is in the On Load event of the form, so it is only executed once, when the form is loaded. It is not executed again as you move through the records. To do that, you will need to have the code in the On Current event - this is the event that occurs when the user moves to a different record - instead of in the On Load event.

  5. #5
    New Lounger
    Join Date
    May 2003
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: what's wrong with this? (Acees 97)

    Thank's alot Hans it did work with "current "
    best regards

Posting Permissions

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