Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    7

    Exclamation Unanswered: How to change toggle button color upon selection

    Utilizing Access 2003... I am attempting to perform the following feat:

    I have a form with an option group containing 4 toggle buttons.

    Option Value = 0 - Assigned ~ Toggle61
    Option Value = 1 - Unassigned ~ Toggle62
    Option Value = 2 - Available ~ Toggle63
    Option Value = 3 - Out of Service ~ Toggle64

    The option group is Frame 58
    Form is: Frm_SystemEntry

    I would like the text color of the toggle button to change to a different color (like red) when selected. However I would like the toggle buttons to stay (depressed if previously selected and the text color changed) even if the form is closed and reopened. I need the visual indicator to notify users of the status of the particular systems.

    I tryed the following code on the Option Group with bad results:

    Private Sub AssignedToggle_BeforeUpdate(Cancel As Integer)
    If Forms!Frm_SystemEntry!.Frame58.Value = 0 Then
    Forms!Frm_SystemEntry!.Frame58.Toggle61.ForeColor = 255 'red
    Forms!Frm_SystemEntry!.Frame58.Toggle61.FontWeight = 700 'bold
    Forms!Frm_SystemEntry!.Frame58.Toggle62.ForeColor = 0 'black
    Forms!Frm_SystemEntry!.Frame58.Toggle62.FontWeight = 400 'normal
    Forms!Frm_SystemEntry!.Frame58.Toggle63.ForeColor = 0 'black
    Forms!Frm_SystemEntry!.Frame58.Toggle63.FontWeight = 400 'normal
    Forms!Frm_SystemEntry!.Frame58.Toggle64.ForeColor = 0 'black
    Forms!Frm_SystemEntry!.Frame58.Toggle64.FontWeight = 400 'normal
    End If
    so on for each Value change 0-3

    Private Sub Frame58_AfterUpdate()
    If Forms!Frm_SystemEntry!.Frame58.Value = 0 Then
    Forms!Frm_SystemEntry!.Frame58.Toggle61.ForeColor = 255 'red
    Forms!Frm_SystemEntry!.Frame58.Toggle61.FontWeight = 700 'bold
    Forms!Frm_SystemEntry!.Frame58.Toggle62.ForeColor = 0 'black
    Forms!Frm_SystemEntry!.Frame58.Toggle62.FontWeight = 400 'normal
    Forms!Frm_SystemEntry!.Frame58.Toggle63.ForeColor = 0 'black
    Forms!Frm_SystemEntry!.Frame58.Toggle63.FontWeight = 400 'normal
    Forms!Frm_SystemEntry!.Frame58.Toggle64.ForeColor = 0 'black
    Forms!Frm_SystemEntry!.Frame58.Toggle64.FontWeight = 400 'normal
    End If

    so on for each Value change 0-3

    Error displayed: Runtime Error 438
    Object doesn't support this property, or method



    Any help would be greatly appreciated!

    Thanks Chris

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The frame should not be included in the form reference.
    Paul

Posting Permissions

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