• Change a Toggle button in VBA

    Author
    Topic
    #466885

    Hi,
    I have a form which the client depresses a toggle button so a text box will appear. Once they enter the data, I open another form to show the records they have requested. When they leave the second form, we go back to the first form. The first form still shows the last toggle button that was depressed. I want to come back to a form without any toggle button showing as depressed. I tried to move FALSE to the toggle button value, but I get an error. Any way I can reset the toggle buttons?
    Thanks,
    Sarge

    Viewing 4 reply threads
    Author
    Replies
    • #1210653

      False ought to reset a toggle button unless it is inside an option group frame.
      What is the error message, and what line of code are you using to set the value.
      Also where is the code that generates the error.

    • #1210656

      I agree with Andrew. Setting the value of the toggle to false should work.
      It does for me, when I put

      Code:
      Me.Toggle97.Value = False

      in the On Activate event for the form.

    • #1210661

      Hi Andrew and John,
      Sorry I forget to add that the toggle buttons are inside a option Group Frame. What is the trick with it?
      Sarge

    • #1210668

      Within the option group, each toggle will have a numerical value . The properties box will tell you the value of each, but they are probably start at 1 and go up.

      So in the OnActive event, set the value of the optionGroup back to 0.

    • #1210770

      Thanks a lot John,
      Sarge

    Viewing 4 reply threads
    Reply To: Change a Toggle button in VBA

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: