Question about tab control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave G @ K2

    #1

    Question about tab control

    I have an unbound form, and on the form is a tab control with 6 pages.
    I have a function which fills the fields with data when the form is
    opened, and another to save everything when it is closed.

    Here's the question - in a couple of instances I want the same field
    to appear on 2 pages. So the 2 fields need to have slightly different
    names, but even so, no problem with the initial loading of data. But
    then I want to arrange it so that if a user changes the contents of
    that field on one page then that change is immediately echoed to the
    same field on the other page. I can't get this to work using either
    Before or After Update.

    Can anyone help with this please.

    TIA Dave

  • Rick Brandt

    #2
    Re: Question about tab control

    Dave G @ K2 wrote:
    I have an unbound form, and on the form is a tab control with 6 pages.
    I have a function which fills the fields with data when the form is
    opened, and another to save everything when it is closed.
    >
    Here's the question - in a couple of instances I want the same field
    to appear on 2 pages. So the 2 fields need to have slightly different
    names, but even so, no problem with the initial loading of data. But
    then I want to arrange it so that if a user changes the contents of
    that field on one page then that change is immediately echoed to the
    same field on the other page. I can't get this to work using either
    Before or After Update.
    >
    Can anyone help with this please.
    >
    TIA Dave
    Just a thought. Place those controls on the form itself rather than a TabPage.
    Then one control will appear on all pages. You can use the Change event of the
    TabControl to hide the controls on certain pages.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com


    Comment

    • Dave G @ K2

      #3
      Re: Question about tab control

      Rick

      Good thought, and I don't want to sound ungrateful, but I don't think
      this is viable because of the positions of the various instances of
      the fields in question

      Dave

      Comment

      • christianlott1@yahoo.com

        #4
        Re: Question about tab control

        Why don't you just use the same control?

        Drag and drop the field name from the field list into the first page
        and the second page. The field automatically 'updates' because it's
        pulling data from the same place.

        As long as the data source for the control is the same field, it will
        contain the same information at all times. No requery required.

        Comment

        • Rick Brandt

          #5
          Re: Question about tab control

          christianlott1@ yahoo.com wrote:
          Why don't you just use the same control?
          >
          Drag and drop the field name from the field list into the first page
          and the second page. The field automatically 'updates' because it's
          pulling data from the same place.
          >
          As long as the data source for the control is the same field, it will
          contain the same information at all times. No requery required.
          This is an *unbound* form he is talking about.

          --
          Rick Brandt, Microsoft Access MVP
          Email (as appropriate) to...
          RBrandt at Hunter dot com


          Comment

          • storrboy

            #6
            Re: Question about tab control

            ...... But
            then I want to arrange it so that if a user changes the contents of
            that field on one page then that change is immediately echoed to the
            same field on the other page. I can't get this to work using either
            Before or After Update.
            >
            Can anyone help with this please.
            >
            TIA Dave
            I think this is the easiest way, but the only reason I can think of
            for it not to work is that when in use, the field is not finished
            being updated before you look at the other, or that either one is in
            the proccess of being updated and can't be changed at that time. You
            could try making the control to lose focus so that the update is
            forced when moving between pages. In the each pages On Change event,
            set the focus to a control that is not one of the two in question.
            This should force them to update, but you may need handle invalid
            entries first (ie. text in a date field).
            In the AfterUpdate events, say Me!Fieldl1=Me!F ield2 and vice versa.

            Comment

            • Tom Clavel

              #7
              Re: Question about tab control

              On Feb 19, 7:13 pm, "storrboy" <storr...@sympa tico.cawrote:
              ..... But
              >
              then I want to arrange it so that if a user changes the contents of
              that field on one page then that change is immediately echoed to the
              same field on the other page. I can't get this to work using either
              Before or After Update.
              >
              this worked in A2000/2003:

              Private Sub Text5_AfterUpda te()
              Text7 = Text5
              End Sub

              Private Sub Text7_AfterUpda te()
              Text5 = Text7
              End Sub

              What version are you using? -tc

              Comment

              • Dave G @ K2

                #8
                Re: Question about tab control

                Thanks everyone

                I'm using Access 2003.

                One of the fields is a combo box and I've found that the After Update
                event fires here and that's where I have put my code to copy from A to
                B.
                On another field I have just used the Lost Focus event to copy the
                value across

                Dave

                Comment

                Working...