Dynamic Highlighting On Continuous Form?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PeteCresswell

    Dynamic Highlighting On Continuous Form?

    I've got a continuous form that is a grid of statistical values.

    When the user clicks on a statistic, something happens (specifically a
    graph is created showing rolling one-year values for the stat in
    question).

    What I'd like to do is have the current cell highlighted somehow so
    its clearer which statistic is "current".

    MouseOver doesn't seem to be an option because the form is continuous
    - i.e. all cells in the column get whatever highlighting I apply in
    MousOver.


    I'm thinking the Enter() event. Second-best, but better than
    nothing.

    But when I try something like:

    -------------------------------
    Sub txtWhatever_Ent er()
    With Me.txtWhatEver
    .SelStart = 0
    .SelLength = 99
    End with
    End Sub
    -------------------------------

    I can only get the highlight if I pause the code.

    Sounds like I'm missing something, but what?
  • Steve Jorgensen

    #2
    Re: Dynamic Highlighting On Continuous Form?

    Anything you do related to setting a property of a field is doomed to failure
    because there is a single control object in charge of all instances of a
    control on a continuous or datasheet form.

    What you need to use is conditional formatting. In fact, I think something
    like "Current Selection" is one of the options in the format condition
    drop-down list.

    On Thu, 12 May 2005 10:14:09 -0400, PeteCresswell <x@y.z.Invali d> wrote:
    [color=blue]
    >I've got a continuous form that is a grid of statistical values.
    >
    >When the user clicks on a statistic, something happens (specifically a
    >graph is created showing rolling one-year values for the stat in
    >question).
    >
    >What I'd like to do is have the current cell highlighted somehow so
    >its clearer which statistic is "current".
    >
    >MouseOver doesn't seem to be an option because the form is continuous
    >- i.e. all cells in the column get whatever highlighting I apply in
    >MousOver.
    >
    >
    >I'm thinking the Enter() event. Second-best, but better than
    >nothing.
    >
    >But when I try something like:
    >
    >-------------------------------
    >Sub txtWhatever_Ent er()
    > With Me.txtWhatEver
    > .SelStart = 0
    > .SelLength = 99
    > End with
    >End Sub
    >-------------------------------
    >
    >I can only get the highlight if I pause the code.
    >
    >Sounds like I'm missing something, but what?[/color]

    Comment

    • PeteCresswell

      #3
      Re: Re: Dynamic Highlighting On Continuous Form?

      On Thu, 12 May 2005 07:26:21 -0700, Steve Jorgensen
      <nospam@nospam. nospam> wrote:[color=blue]
      >What you need to use is conditional formatting. In fact, I think something
      >like "Current Selection" is one of the options in the format condition
      >drop-down list.[/color]

      Thanks - I'll start looking at that right now.

      Also, on the ".Select", I had the wrong event. Shb Click().

      Comment

      • shumaker@cs.fsu.edu

        #4
        Re: Dynamic Highlighting On Continuous Form?

        Yes there is a current selection criteria in conditional formatting.
        It works very well with datasheets. You have to go through and set
        this for every column you want the highlighting to occur on. And even
        then it only highlights the cell, not the whole row. But it is still
        nice.

        Comment

        • (PeteCresswell)

          #5
          Re: Dynamic Highlighting On Continuous Form?

          Per shumaker@cs.fsu .edu:[color=blue]
          >You have to go through and set
          >this for every column you want the highlighting to occur on. And even
          >then it only highlights the cell, not the whole row. But it is still
          >nice.[/color]

          Just the cell and not the row is exactly what I want.

          But I haven't found anything yet. Maybe I'm looking in the wrong place.
          I've been looking at .Format. Should I be looking for some kind of event?
          --
          PeteCresswell

          Comment

          • John Mishefske

            #6
            Re: Dynamic Highlighting On Continuous Form?

            (PeteCresswell) wrote:[color=blue]
            > Per shumaker@cs.fsu .edu:
            >[color=green]
            >>You have to go through and set
            >>this for every column you want the highlighting to occur on. And even
            >>then it only highlights the cell, not the whole row. But it is still
            >>nice.[/color]
            >
            >
            > Just the cell and not the row is exactly what I want.
            >
            > But I haven't found anything yet. Maybe I'm looking in the wrong place.
            > I've been looking at .Format. Should I be looking for some kind of event?[/color]

            Pete - the solution I've used is to write my own class to do this; perhaps that is an
            option to consider. You can create some number of rows of controls on a form and hide
            them. Make the appropriate number of rows and columns visible and implement your own
            navigation code to fill those controls.

            Define the controls WithEvents and you can do things like MouseOver or Conditional
            formatting to your heart's content. Takes a bit of programming but you would have your own
            custom "Continuous form" tool.

            --
            '---------------
            'John Mishefske
            '---------------

            Comment

            • Steve Jorgensen

              #7
              Re: Dynamic Highlighting On Continuous Form?

              On Thu, 12 May 2005 20:44:28 -0700, "(PeteCresswell )" <x@y.z.invali d> wrote:
              [color=blue]
              >Per shumaker@cs.fsu .edu:[color=green]
              >>You have to go through and set
              >>this for every column you want the highlighting to occur on. And even
              >>then it only highlights the cell, not the whole row. But it is still
              >>nice.[/color]
              >
              >Just the cell and not the row is exactly what I want.
              >
              >But I haven't found anything yet. Maybe I'm looking in the wrong place.
              >I've been looking at .Format. Should I be looking for some kind of event?[/color]

              You can get to it from code, but you don't need to. Just select Conditional
              Formatting from the menu in form design. If you want, you can select multiple
              fields first, and set them all at once, but they must have -exactly- the same
              formatting for that to work (otherwise, you get a cryptic error at the end).

              Comment

              • PeteCresswell

                #8
                Re: Re: Dynamic Highlighting On Continuous Form?

                On Thu, 12 May 2005 20:59:49 -0700, Steve Jorgensen
                <nospam@nospam. nospam> wrote:
                [color=blue]
                >You can get to it from code, but you don't need to. Just select Conditional
                >Formatting from the menu in form design. If you want, you can select multiple
                >fields first, and set them all at once, but they must have -exactly- the same
                >formatting for that to work (otherwise, you get a cryptic error at the end).[/color]

                Found it. But it seems value-oriented - i.e. no provision for
                "Currently-Selected".

                John M's approach sounds interesting - all the more so bc it would be
                re-usable. Maybe I'll start pecking away at that.

                Comment

                • Steve Jorgensen

                  #9
                  Re: Dynamic Highlighting On Continuous Form?

                  On Fri, 13 May 2005 11:01:15 -0400, PeteCresswell <x@y.z.Invali d> wrote:
                  [color=blue]
                  >On Thu, 12 May 2005 20:59:49 -0700, Steve Jorgensen
                  ><nospam@nospam .nospam> wrote:
                  >[color=green]
                  >>You can get to it from code, but you don't need to. Just select Conditional
                  >>Formatting from the menu in form design. If you want, you can select multiple
                  >>fields first, and set them all at once, but they must have -exactly- the same
                  >>formatting for that to work (otherwise, you get a cryptic error at the end).[/color]
                  >
                  >Found it. But it seems value-oriented - i.e. no provision for
                  >"Currently-Selected".[/color]

                  That's what "Field Has Focus" means. Do you not see that option in the first
                  drop-down on the left?
                  [color=blue]
                  >
                  >John M's approach sounds interesting - all the more so bc it would be
                  >re-usable. Maybe I'll start pecking away at that.[/color]

                  Comment

                  • (PeteCresswell)

                    #10
                    Re: Dynamic Highlighting On Continuous Form?

                    Per Steve Jorgensen:[color=blue]
                    >That's what "Field Has Focus" means. Do you not see that option in the first
                    >drop-down on the left?[/color]

                    A mild case of RCI on my part. I looked at the range-suggestive fields and
                    said to myself "Nope, that's not the one...." - without popping the combo box.

                    This lets me do exactly, *precisely* what I wanted to do.

                    Thanks again - and sorry for being so dense.
                    --
                    PeteCresswell

                    Comment

                    Working...