Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fore colour (Access 2000)

    I have a function called set caption that should change the colour of the caption, i works ut always stays red.Why is it so ?

    Private Sub SetCaption()
    With Me.CmdBonus
    If .Value = True Then
    .Caption = "Bonus"
    .ForeColor = vbRed
    Else
    .Caption = ""
    .ForeColor = vbBlack
    End If
    End With
    End Sub

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Fore colour (Access 2000)

    If you change the caption to "" then there is no Text, so the ForeColor is irrelevant, so why bother?

    You are testing for the value of cmdBonus, which is presumably a command button.
    Command buttons do not have a value, so what are you trying to test for?
    Regards
    John



Posting Permissions

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