Update All Rows on Continuous form Based on Selection in Footer

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

    Update All Rows on Continuous form Based on Selection in Footer

    All,

    I've got a continuous form with one field on it, with a comob
  • Patrick A

    #2
    Re: Update All Rows on Continuous form Based on Selection in Footer

    Sorry about the auto-post. Don't know what keys I hit.

    I have a continuous form with a combo box and a field on it, and a
    combo box in the footer.
    -----------
    {body cbox} [field]
    -----------
    {body cbox} [field]
    -----------
    ______
    -----------
    [footer cbox]
    -----------

    Let's say the combo box on the form is for the drinks I want...and I
    can choose Martini, Gimlet, etc.

    I can choose as many drinks as I want.

    The combo box in the footer is my choice of liquor.

    -----------
    Gimlet [liquor]
    -----------
    Martini [liquor]
    -----------
    ______
    -----------
    Gin
    -----------

    I only get to choose one type of liquor for any and all drinks. (Sad
    example, but there you go. This is driving me to drink.)

    Right now, the way my form behaves is when I change my type of liquor
    in the footer, it only changes the type of liquor for the row I am
    "on" in the body of the form. (I'm using an after update event in the
    combo box in the footer:
    Me.TB_Body = Me.CB_Footer.)

    How can I get it to change the type of liquor for ALL rows in the body
    of the form?

    Thanks,

    Patrick

    Comment

    • Guillermo_Lopez

      #3
      Re: Update All Rows on Continuous form Based on Selection in Footer

      On Mar 26, 5:35 pm, Patrick A <park...@stradl ey.comwrote:
      Sorry about the auto-post.  Don't know what keys I hit.
      >
      I have a continuous form with a combo box and a field on it, and a
      combo box in the footer.
      -----------
      {body cbox}   [field]
      -----------
      {body cbox}   [field]
      -----------
      ______
      -----------
      [footer cbox]
      -----------
      >
      Let's say the combo box on the form is for the drinks I want...and I
      can choose Martini, Gimlet, etc.
      >
      I can choose as many drinks as I want.
      >
      The combo box in the footer is my choice of liquor.
      >
      -----------
      Gimlet   [liquor]
      -----------
      Martini   [liquor]
      -----------
      ______
      -----------
      Gin
      -----------
      >
      I only get to choose one type of liquor for any and all drinks.  (Sad
      example, but there you go.  This is driving me to drink.)
      >
      Right now, the way my form behaves is when I change my type of liquor
      in the footer, it only changes the type of liquor for the row I am
      "on" in the body of the form.  (I'm using an after update event in the
      combo box in the footer:
      Me.TB_Body = Me.CB_Footer.)
      >
      How can I get it to change the type of liquor for ALL rows in the body
      of the form?
      >
      Thanks,
      >
      Patrick
      Patrick

      Just be careful not to drive after drinking.

      You can use a loop to go through all the rows in the form. I haven't
      done this so i don't know the exact commands (those inside #) for most
      of this so here is my best.

      for i = 1 to #recordcount#
      Me.TB_Body = Me.CB_Footer.
      DoCmd.GoToRecor d acDataForm, "FormName", acGoTo, i
      next i

      I can't find how to get the number of record in the Form. Best why i
      can think of is to have a text control that counts the total number of
      fields Count(*). And using that. Perhaps somebody else has a better
      solution. Most of the stuff i've found in the net, have a ton of
      coding.

      - GL

      Comment

      • Patrick A

        #4
        Re: Update All Rows on Continuous form Based on Selection in Footer

        Guillermo,

        Thanks for that

        Hmmmm.

        Any idea how I can get the name of the current subform, given that I
        have 6 instances of it on my form, and the user could be in any of
        them?

        (When I use the Object Name of the form, Access tells me it's not
        open.)


        Thanks,

        Patrick

        Comment

        • Stuart McCall

          #5
          Re: Update All Rows on Continuous form Based on Selection in Footer

          "Patrick A" <parkins@stradl ey.comwrote in message
          news:2e84f461-56a4-4145-a674-42b27b155acb@a1 g2000hsb.google groups.com...
          Guillermo,
          >
          Thanks for that
          >
          Hmmmm.
          >
          Any idea how I can get the name of the current subform, given that I
          have 6 instances of it on my form, and the user could be in any of
          them?
          >
          (When I use the Object Name of the form, Access tells me it's not
          open.)
          >
          >
          Thanks,
          >
          Patrick
          Try:

          Me.Parent.Name

          That should give you the name of the subform control that is hosting your
          form.


          Comment

          • Patrick A

            #6
            Re: Update All Rows on Continuous form Based on Selection in Footer

            Stuart,

            Thanks for your response.

            me.Parent.name gives me the Object name (FRM_My_SubForm ) of the parent
            form.
            me.name gives me the Object name of the parent form (FRM_My_Form) .

            I need the "Instance" name of the form, e.g. Forms!FRM_Inst1 !
            SFRM_Inst1, or Forms!FRM_Inst1 !SFRM_Inst2, etc.

            Any suggestions?

            Comment

            • Stuart McCall

              #7
              Re: Update All Rows on Continuous form Based on Selection in Footer

              "Patrick A" <parkins@stradl ey.comwrote in message
              news:baf99838-ac0b-49dc-ab39-275483c57374@c6 5g2000hsa.googl egroups.com...
              Stuart,
              >
              Thanks for your response.
              >
              me.Parent.name gives me the Object name (FRM_My_SubForm ) of the parent
              form.
              That sure sounds like the name of a subform control on the parent form
              (which is the 'instance' name you mention). It certainly doesn't sound like
              the name of the parent form. I think you need to take another look.
              me.name gives me the Object name of the parent form (FRM_My_Form) .
              No, if the code is running on the subform, it gives you the name of _that_
              form.
              >
              I need the "Instance" name of the form, e.g. Forms!FRM_Inst1 !
              SFRM_Inst1, or Forms!FRM_Inst1 !SFRM_Inst2, etc.
              >
              Any suggestions?

              Comment

              • Patrick A

                #8
                Re: Update All Rows on Continuous form Based on Selection in Footer

                Sorry, I miss-typed. Still trying to figure this out.

                Invoked in the AfterUpdate event of the control on the sub form,
                me.parent.name gives me the Object name (FRM_My_Form) of the Parent form.
                me.name gives me the Object name of the Child form (SFRM_My_SubFor m) .
                I need the "Instance" name of the form,
                e.g. Forms!FRM_My_Fo rm_Inst1!SFRM_M y_SubForm_Inst1 , or Forms!
                FRM_My_Form_Ins t1!SFRM_My_SubF orm_Inst2, etc.

                Thanks,

                Patrick

                Comment

                • Stuart McCall

                  #9
                  Re: Update All Rows on Continuous form Based on Selection in Footer

                  "Patrick A" <parkins@stradl ey.comwrote in message
                  news:7a91c716-8abb-488d-b2fa-e9e7c9c11df6@8g 2000hsu.googleg roups.com...
                  Sorry, I miss-typed. Still trying to figure this out.
                  >
                  Invoked in the AfterUpdate event of the control on the sub form,
                  >
                  >me.parent.na me gives me the Object name (FRM_My_Form) of the Parent form.
                  >
                  >me.name gives me the Object name of the Child form (SFRM_My_SubFor m) .
                  >
                  I need the "Instance" name of the form,
                  e.g. Forms!FRM_My_Fo rm_Inst1!SFRM_M y_SubForm_Inst1 , or Forms!
                  FRM_My_Form_Ins t1!SFRM_My_SubF orm_Inst2, etc.
                  >
                  Thanks,
                  >
                  Patrick
                  Ok, I've looked back through the thread and I'm not certain I have your
                  model correct in my mind. Let's review: As I understand it you have one main
                  form containing 6 subform controls, all of which contain the same form,
                  showing different data, presumably (else why do it).

                  Is that a correct summation?


                  Comment

                  • Patrick A

                    #10
                    Re: Update All Rows on Continuous form Based on Selection in Footer

                    On Mar 31, 3:02 pm, "Stuart McCall" <smcc...@myunre albox.comwrote:

                    Stuart,
                    Ok, I've looked back through the thread and I'm not certain I have your
                    model correct in my mind. Let's review: As I understand it you have one main
                    form containing 6 subform controls, all of which contain the same form,
                    showing different data, presumably (else why do it).
                    >
                    Is that a correct summation?
                    Yes, that is correct.

                    While the Object name of the subform might be SFRM_Mine, the name I've
                    given it when I added it to the main form is what I'm after, e.g.
                    SFRM_Mine_Inst1 , SFRM_Mine_Inst2 , SFRM_Mine_Inst3 , etc.

                    Thanks,

                    Patrick

                    Comment

                    Working...