+ Reply to Thread
Results 1 to 8 of 8

need help with togglebutton

  1. #1
    Gary Keramidas
    Guest

    need help with togglebutton

    i have a command button that imports data and creates a chart. it always
    creates the chart by rows.
    i also have a togglebutton that changes the source to columns and then back
    to rows.

    the problem is, if the last selection was by columns, and i click the report
    button, the chart comes in by rows, but the toggle button is clicked,
    nothing happens because it is already in the source by row mode. i need to
    click the button twice to reset it.

    i need to select the toggle button from the command button code and reset
    it's state. that way, every time the report is generated, the toggle button
    will be in the original state, sort by column when it's clicked.

    can someone hlep me out please?

    --


    Gary




  2. #2
    Scott Vincent
    Guest

    RE: need help with togglebutton

    Try putting this in your code that generates the chart:

    Me.tglTest = False

    Assumes the code running is on the same sheet as the toggle button. If not,
    you will have to specify the sheet rather than use me. False will unselect
    the toggle button and True will select it. The tglTest is just the name I
    gave my test toggle button.

    Let me know if you still have issues.
    --
    Happy Coding,

    Scott


    "Gary Keramidas" wrote:

    > i have a command button that imports data and creates a chart. it always
    > creates the chart by rows.
    > i also have a togglebutton that changes the source to columns and then back
    > to rows.
    >
    > the problem is, if the last selection was by columns, and i click the report
    > button, the chart comes in by rows, but the toggle button is clicked,
    > nothing happens because it is already in the source by row mode. i need to
    > click the button twice to reset it.
    >
    > i need to select the toggle button from the command button code and reset
    > it's state. that way, every time the report is generated, the toggle button
    > will be in the original state, sort by column when it's clicked.
    >
    > can someone hlep me out please?
    >
    > --
    >
    >
    > Gary
    >
    >
    >
    >


  3. #3
    Gary Keramidas
    Guest

    Re: need help with togglebutton

    scott:

    what do i use for the Me variable? i don't know how to address the
    togglebutton, and yes it's on the same sheet as the code.

    --


    Gary


    "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    news:DD9F4396-F423-47BC-B15E-9FEDBF51CBA3@microsoft.com...
    > Try putting this in your code that generates the chart:
    >
    > Me.tglTest = False
    >
    > Assumes the code running is on the same sheet as the toggle button. If
    > not,
    > you will have to specify the sheet rather than use me. False will
    > unselect
    > the toggle button and True will select it. The tglTest is just the name I
    > gave my test toggle button.
    >
    > Let me know if you still have issues.
    > --
    > Happy Coding,
    >
    > Scott
    >
    >
    > "Gary Keramidas" wrote:
    >
    >> i have a command button that imports data and creates a chart. it always
    >> creates the chart by rows.
    >> i also have a togglebutton that changes the source to columns and then
    >> back
    >> to rows.
    >>
    >> the problem is, if the last selection was by columns, and i click the
    >> report
    >> button, the chart comes in by rows, but the toggle button is clicked,
    >> nothing happens because it is already in the source by row mode. i need
    >> to
    >> click the button twice to reset it.
    >>
    >> i need to select the toggle button from the command button code and reset
    >> it's state. that way, every time the report is generated, the toggle
    >> button
    >> will be in the original state, sort by column when it's clicked.
    >>
    >> can someone hlep me out please?
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >>
    >>




  4. #4
    Scott Vincent
    Guest

    Re: need help with togglebutton

    Me is a reference to the current sheet, not a variable. When you type "Me."
    you will see all of the controls on the sheet by name. Select the name of
    the toggle button. You can even leave Me out if you like. I use it because
    it makes it easier that remembering the names of the controls on the sheet.
    If you do not know the name of the toggle button you can look at the
    properties of it on the sheet. It is the name property. You can also double
    click it if you are in design mode and it will open the code for the toggle
    button and you will see the name. Remember to use the code snippet provided
    in the code under the command button.

    Let me know if this still does not make sense. I will check my email
    tomorrow.
    --
    Happy Coding,

    Scott


    "Gary Keramidas" wrote:

    > scott:
    >
    > what do i use for the Me variable? i don't know how to address the
    > togglebutton, and yes it's on the same sheet as the code.
    >
    > --
    >
    >
    > Gary
    >
    >
    > "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    > news:DD9F4396-F423-47BC-B15E-9FEDBF51CBA3@microsoft.com...
    > > Try putting this in your code that generates the chart:
    > >
    > > Me.tglTest = False
    > >
    > > Assumes the code running is on the same sheet as the toggle button. If
    > > not,
    > > you will have to specify the sheet rather than use me. False will
    > > unselect
    > > the toggle button and True will select it. The tglTest is just the name I
    > > gave my test toggle button.
    > >
    > > Let me know if you still have issues.
    > > --
    > > Happy Coding,
    > >
    > > Scott
    > >
    > >
    > > "Gary Keramidas" wrote:
    > >
    > >> i have a command button that imports data and creates a chart. it always
    > >> creates the chart by rows.
    > >> i also have a togglebutton that changes the source to columns and then
    > >> back
    > >> to rows.
    > >>
    > >> the problem is, if the last selection was by columns, and i click the
    > >> report
    > >> button, the chart comes in by rows, but the toggle button is clicked,
    > >> nothing happens because it is already in the source by row mode. i need
    > >> to
    > >> click the button twice to reset it.
    > >>
    > >> i need to select the toggle button from the command button code and reset
    > >> it's state. that way, every time the report is generated, the toggle
    > >> button
    > >> will be in the original state, sort by column when it's clicked.
    > >>
    > >> can someone hlep me out please?
    > >>
    > >> --
    > >>
    > >>
    > >> Gary
    > >>
    > >>
    > >>
    > >>

    >
    >
    >


  5. #5
    Gary Keramidas
    Guest

    Re: need help with togglebutton

    i know it is togglebutton1. when i put Me.tglTest = False in the code, get a
    message, invalid use of Me keyword

    --


    Gary


    "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    news:0BA04BD5-164B-4D96-ADCF-15395ECA3347@microsoft.com...
    > Me is a reference to the current sheet, not a variable. When you type
    > "Me."
    > you will see all of the controls on the sheet by name. Select the name of
    > the toggle button. You can even leave Me out if you like. I use it
    > because
    > it makes it easier that remembering the names of the controls on the
    > sheet.
    > If you do not know the name of the toggle button you can look at the
    > properties of it on the sheet. It is the name property. You can also
    > double
    > click it if you are in design mode and it will open the code for the
    > toggle
    > button and you will see the name. Remember to use the code snippet
    > provided
    > in the code under the command button.
    >
    > Let me know if this still does not make sense. I will check my email
    > tomorrow.
    > --
    > Happy Coding,
    >
    > Scott
    >
    >
    > "Gary Keramidas" wrote:
    >
    >> scott:
    >>
    >> what do i use for the Me variable? i don't know how to address the
    >> togglebutton, and yes it's on the same sheet as the code.
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >> "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    >> news:DD9F4396-F423-47BC-B15E-9FEDBF51CBA3@microsoft.com...
    >> > Try putting this in your code that generates the chart:
    >> >
    >> > Me.tglTest = False
    >> >
    >> > Assumes the code running is on the same sheet as the toggle button. If
    >> > not,
    >> > you will have to specify the sheet rather than use me. False will
    >> > unselect
    >> > the toggle button and True will select it. The tglTest is just the
    >> > name I
    >> > gave my test toggle button.
    >> >
    >> > Let me know if you still have issues.
    >> > --
    >> > Happy Coding,
    >> >
    >> > Scott
    >> >
    >> >
    >> > "Gary Keramidas" wrote:
    >> >
    >> >> i have a command button that imports data and creates a chart. it
    >> >> always
    >> >> creates the chart by rows.
    >> >> i also have a togglebutton that changes the source to columns and then
    >> >> back
    >> >> to rows.
    >> >>
    >> >> the problem is, if the last selection was by columns, and i click the
    >> >> report
    >> >> button, the chart comes in by rows, but the toggle button is clicked,
    >> >> nothing happens because it is already in the source by row mode. i
    >> >> need
    >> >> to
    >> >> click the button twice to reset it.
    >> >>
    >> >> i need to select the toggle button from the command button code and
    >> >> reset
    >> >> it's state. that way, every time the report is generated, the toggle
    >> >> button
    >> >> will be in the original state, sort by column when it's clicked.
    >> >>
    >> >> can someone hlep me out please?
    >> >>
    >> >> --
    >> >>
    >> >>
    >> >> Gary
    >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  6. #6
    Gary Keramidas
    Guest

    Re: need help with togglebutton

    got it to work, finally
    Me.ToggleButton1 = True

    thanks for your help

    --


    Gary


    "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    news:0BA04BD5-164B-4D96-ADCF-15395ECA3347@microsoft.com...
    > Me is a reference to the current sheet, not a variable. When you type
    > "Me."
    > you will see all of the controls on the sheet by name. Select the name of
    > the toggle button. You can even leave Me out if you like. I use it
    > because
    > it makes it easier that remembering the names of the controls on the
    > sheet.
    > If you do not know the name of the toggle button you can look at the
    > properties of it on the sheet. It is the name property. You can also
    > double
    > click it if you are in design mode and it will open the code for the
    > toggle
    > button and you will see the name. Remember to use the code snippet
    > provided
    > in the code under the command button.
    >
    > Let me know if this still does not make sense. I will check my email
    > tomorrow.
    > --
    > Happy Coding,
    >
    > Scott
    >
    >
    > "Gary Keramidas" wrote:
    >
    >> scott:
    >>
    >> what do i use for the Me variable? i don't know how to address the
    >> togglebutton, and yes it's on the same sheet as the code.
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >> "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    >> news:DD9F4396-F423-47BC-B15E-9FEDBF51CBA3@microsoft.com...
    >> > Try putting this in your code that generates the chart:
    >> >
    >> > Me.tglTest = False
    >> >
    >> > Assumes the code running is on the same sheet as the toggle button. If
    >> > not,
    >> > you will have to specify the sheet rather than use me. False will
    >> > unselect
    >> > the toggle button and True will select it. The tglTest is just the
    >> > name I
    >> > gave my test toggle button.
    >> >
    >> > Let me know if you still have issues.
    >> > --
    >> > Happy Coding,
    >> >
    >> > Scott
    >> >
    >> >
    >> > "Gary Keramidas" wrote:
    >> >
    >> >> i have a command button that imports data and creates a chart. it
    >> >> always
    >> >> creates the chart by rows.
    >> >> i also have a togglebutton that changes the source to columns and then
    >> >> back
    >> >> to rows.
    >> >>
    >> >> the problem is, if the last selection was by columns, and i click the
    >> >> report
    >> >> button, the chart comes in by rows, but the toggle button is clicked,
    >> >> nothing happens because it is already in the source by row mode. i
    >> >> need
    >> >> to
    >> >> click the button twice to reset it.
    >> >>
    >> >> i need to select the toggle button from the command button code and
    >> >> reset
    >> >> it's state. that way, every time the report is generated, the toggle
    >> >> button
    >> >> will be in the original state, sort by column when it's clicked.
    >> >>
    >> >> can someone hlep me out please?
    >> >>
    >> >> --
    >> >>
    >> >>
    >> >> Gary
    >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  7. #7
    Scott Vincent
    Guest

    Re: need help with togglebutton

    I'm glad you got it. ToggleButton1 is the default name for a toggle button.
    I usually rename the controls I put on a form to standard naming conventions.
    Sorry about the confusion. Did you notice the auto list that displayed when
    you typed "Me."? You should have been able to type Tog and it would have
    taken you right to the ToggleButton1 control.
    --
    Happy Coding,

    Scott


    "Gary Keramidas" wrote:

    > got it to work, finally
    > Me.ToggleButton1 = True
    >
    > thanks for your help
    >
    > --
    >
    >
    > Gary
    >
    >
    > "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    > news:0BA04BD5-164B-4D96-ADCF-15395ECA3347@microsoft.com...
    > > Me is a reference to the current sheet, not a variable. When you type
    > > "Me."
    > > you will see all of the controls on the sheet by name. Select the name of
    > > the toggle button. You can even leave Me out if you like. I use it
    > > because
    > > it makes it easier that remembering the names of the controls on the
    > > sheet.
    > > If you do not know the name of the toggle button you can look at the
    > > properties of it on the sheet. It is the name property. You can also
    > > double
    > > click it if you are in design mode and it will open the code for the
    > > toggle
    > > button and you will see the name. Remember to use the code snippet
    > > provided
    > > in the code under the command button.
    > >
    > > Let me know if this still does not make sense. I will check my email
    > > tomorrow.
    > > --
    > > Happy Coding,
    > >
    > > Scott
    > >
    > >
    > > "Gary Keramidas" wrote:
    > >
    > >> scott:
    > >>
    > >> what do i use for the Me variable? i don't know how to address the
    > >> togglebutton, and yes it's on the same sheet as the code.
    > >>
    > >> --
    > >>
    > >>
    > >> Gary
    > >>
    > >>
    > >> "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    > >> news:DD9F4396-F423-47BC-B15E-9FEDBF51CBA3@microsoft.com...
    > >> > Try putting this in your code that generates the chart:
    > >> >
    > >> > Me.tglTest = False
    > >> >
    > >> > Assumes the code running is on the same sheet as the toggle button. If
    > >> > not,
    > >> > you will have to specify the sheet rather than use me. False will
    > >> > unselect
    > >> > the toggle button and True will select it. The tglTest is just the
    > >> > name I
    > >> > gave my test toggle button.
    > >> >
    > >> > Let me know if you still have issues.
    > >> > --
    > >> > Happy Coding,
    > >> >
    > >> > Scott
    > >> >
    > >> >
    > >> > "Gary Keramidas" wrote:
    > >> >
    > >> >> i have a command button that imports data and creates a chart. it
    > >> >> always
    > >> >> creates the chart by rows.
    > >> >> i also have a togglebutton that changes the source to columns and then
    > >> >> back
    > >> >> to rows.
    > >> >>
    > >> >> the problem is, if the last selection was by columns, and i click the
    > >> >> report
    > >> >> button, the chart comes in by rows, but the toggle button is clicked,
    > >> >> nothing happens because it is already in the source by row mode. i
    > >> >> need
    > >> >> to
    > >> >> click the button twice to reset it.
    > >> >>
    > >> >> i need to select the toggle button from the command button code and
    > >> >> reset
    > >> >> it's state. that way, every time the report is generated, the toggle
    > >> >> button
    > >> >> will be in the original state, sort by column when it's clicked.
    > >> >>
    > >> >> can someone hlep me out please?
    > >> >>
    > >> >> --
    > >> >>
    > >> >>
    > >> >> Gary
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  8. #8
    Gary Keramidas
    Guest

    Re: need help with togglebutton

    scott:

    didn't know where to type Me. to get the list to display

    --


    Gary


    "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    news:24BD772F-B4A0-425D-952F-B24999E36F8F@microsoft.com...
    > I'm glad you got it. ToggleButton1 is the default name for a toggle
    > button.
    > I usually rename the controls I put on a form to standard naming
    > conventions.
    > Sorry about the confusion. Did you notice the auto list that displayed
    > when
    > you typed "Me."? You should have been able to type Tog and it would have
    > taken you right to the ToggleButton1 control.
    > --
    > Happy Coding,
    >
    > Scott
    >
    >
    > "Gary Keramidas" wrote:
    >
    >> got it to work, finally
    >> Me.ToggleButton1 = True
    >>
    >> thanks for your help
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >> "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    >> news:0BA04BD5-164B-4D96-ADCF-15395ECA3347@microsoft.com...
    >> > Me is a reference to the current sheet, not a variable. When you type
    >> > "Me."
    >> > you will see all of the controls on the sheet by name. Select the name
    >> > of
    >> > the toggle button. You can even leave Me out if you like. I use it
    >> > because
    >> > it makes it easier that remembering the names of the controls on the
    >> > sheet.
    >> > If you do not know the name of the toggle button you can look at the
    >> > properties of it on the sheet. It is the name property. You can also
    >> > double
    >> > click it if you are in design mode and it will open the code for the
    >> > toggle
    >> > button and you will see the name. Remember to use the code snippet
    >> > provided
    >> > in the code under the command button.
    >> >
    >> > Let me know if this still does not make sense. I will check my email
    >> > tomorrow.
    >> > --
    >> > Happy Coding,
    >> >
    >> > Scott
    >> >
    >> >
    >> > "Gary Keramidas" wrote:
    >> >
    >> >> scott:
    >> >>
    >> >> what do i use for the Me variable? i don't know how to address the
    >> >> togglebutton, and yes it's on the same sheet as the code.
    >> >>
    >> >> --
    >> >>
    >> >>
    >> >> Gary
    >> >>
    >> >>
    >> >> "Scott Vincent" <sgv2000@hotmail.com.> wrote in message
    >> >> news:DD9F4396-F423-47BC-B15E-9FEDBF51CBA3@microsoft.com...
    >> >> > Try putting this in your code that generates the chart:
    >> >> >
    >> >> > Me.tglTest = False
    >> >> >
    >> >> > Assumes the code running is on the same sheet as the toggle button.
    >> >> > If
    >> >> > not,
    >> >> > you will have to specify the sheet rather than use me. False will
    >> >> > unselect
    >> >> > the toggle button and True will select it. The tglTest is just the
    >> >> > name I
    >> >> > gave my test toggle button.
    >> >> >
    >> >> > Let me know if you still have issues.
    >> >> > --
    >> >> > Happy Coding,
    >> >> >
    >> >> > Scott
    >> >> >
    >> >> >
    >> >> > "Gary Keramidas" wrote:
    >> >> >
    >> >> >> i have a command button that imports data and creates a chart. it
    >> >> >> always
    >> >> >> creates the chart by rows.
    >> >> >> i also have a togglebutton that changes the source to columns and
    >> >> >> then
    >> >> >> back
    >> >> >> to rows.
    >> >> >>
    >> >> >> the problem is, if the last selection was by columns, and i click
    >> >> >> the
    >> >> >> report
    >> >> >> button, the chart comes in by rows, but the toggle button is
    >> >> >> clicked,
    >> >> >> nothing happens because it is already in the source by row mode. i
    >> >> >> need
    >> >> >> to
    >> >> >> click the button twice to reset it.
    >> >> >>
    >> >> >> i need to select the toggle button from the command button code and
    >> >> >> reset
    >> >> >> it's state. that way, every time the report is generated, the
    >> >> >> toggle
    >> >> >> button
    >> >> >> will be in the original state, sort by column when it's clicked.
    >> >> >>
    >> >> >> can someone hlep me out please?
    >> >> >>
    >> >> >> --
    >> >> >>
    >> >> >>
    >> >> >> Gary
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1