Q: RejectChanges problem

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

    Q: RejectChanges problem

    Hi

    Can anybody suggest how to get round the following problem?

    I have a form (form A for the sake of argument) which accepts data to be put
    into a DataTable. If the cancel button is pressed, I call RejectChanges to
    prevent the inputted data being passed to the DataTable. However, I also
    have a button on the form which calls another form (which I'll refer to as
    form B) which can also populate the table. In this form there is also a
    cancel button to which I call RejectChanges i.e. in order that the data
    inputted in its form can be rejected.

    The problem is this, if the user inputs data in form A, and then enters form
    B and inputs some data, but then decides that the last set of data is wrong
    and presses Cancel then ALL the data is lost i.e. that from A and B (where
    the intention is to only lose that from form B).

    Now, I don't want to write any data to the database that the table is
    attached to i.e. I don't want to use Update until the user leaves form A (by
    pressing "OK" or something).

    Can you see my problem? What I think I need is some way to say that the data
    in B can be lost but without losing anything from A. Almost a "partial
    reject changes". Is there such a thing?

    Hope somebody can help.

    Geoff


  • Terry Burns

    #2
    Re: RejectChanges problem

    Yes, make the second form open in Modal, this will prevent you from
    accessing form A until you finish with form B.

    --
    Terry Burns



    "Geoff" <nodamnspam@ema il.com> wrote in message
    news:YqmdnXjAPu B06XLenZ2dnUVZ8 qWdnZ2d@pipex.n et...[color=blue]
    > Hi
    >
    > Can anybody suggest how to get round the following problem?
    >
    > I have a form (form A for the sake of argument) which accepts data to be
    > put into a DataTable. If the cancel button is pressed, I call
    > RejectChanges to prevent the inputted data being passed to the DataTable.
    > However, I also have a button on the form which calls another form (which
    > I'll refer to as form B) which can also populate the table. In this form
    > there is also a cancel button to which I call RejectChanges i.e. in order
    > that the data inputted in its form can be rejected.
    >
    > The problem is this, if the user inputs data in form A, and then enters
    > form B and inputs some data, but then decides that the last set of data is
    > wrong and presses Cancel then ALL the data is lost i.e. that from A and B
    > (where the intention is to only lose that from form B).
    >
    > Now, I don't want to write any data to the database that the table is
    > attached to i.e. I don't want to use Update until the user leaves form A
    > (by pressing "OK" or something).
    >
    > Can you see my problem? What I think I need is some way to say that the
    > data in B can be lost but without losing anything from A. Almost a
    > "partial reject changes". Is there such a thing?
    >
    > Hope somebody can help.
    >
    > Geoff
    >
    >[/color]


    Comment

    • Geoff

      #3
      Re: RejectChanges problem

      Hi Terry

      I'm afraid I didn't explain myself too clearly. Basically form A and B have
      access to a global DataTable. If I make changes to the DataTable in A, enter
      B and make changes to the DataTable and then press Cancel (calling
      RejectChanges for the DataTable) I will also reject the changes made in form
      A - which is not intended i.e. all I want to do by pressing Cancel in form B
      is to reject the changes made in it.

      So, what I'm looking for is a way to reject the changes made in form B AND
      ONLY in form B. RejectChanges seems to clear everything.

      Can you help?

      Geoff


      "Terry Burns" <me@mine.com> wrote in message
      news:uR54ZcAMGH A.1032@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Yes, make the second form open in Modal, this will prevent you from
      > accessing form A until you finish with form B.
      >
      > --
      > Terry Burns
      > http://TrainingOn.net
      >
      >
      > "Geoff" <nodamnspam@ema il.com> wrote in message
      > news:YqmdnXjAPu B06XLenZ2dnUVZ8 qWdnZ2d@pipex.n et...[color=green]
      >> Hi
      >>
      >> Can anybody suggest how to get round the following problem?
      >>
      >> I have a form (form A for the sake of argument) which accepts data to be
      >> put into a DataTable. If the cancel button is pressed, I call
      >> RejectChanges to prevent the inputted data being passed to the DataTable.
      >> However, I also have a button on the form which calls another form (which
      >> I'll refer to as form B) which can also populate the table. In this form
      >> there is also a cancel button to which I call RejectChanges i.e. in order
      >> that the data inputted in its form can be rejected.
      >>
      >> The problem is this, if the user inputs data in form A, and then enters
      >> form B and inputs some data, but then decides that the last set of data
      >> is wrong and presses Cancel then ALL the data is lost i.e. that from A
      >> and B (where the intention is to only lose that from form B).
      >>
      >> Now, I don't want to write any data to the database that the table is
      >> attached to i.e. I don't want to use Update until the user leaves form A
      >> (by pressing "OK" or something).
      >>
      >> Can you see my problem? What I think I need is some way to say that the
      >> data in B can be lost but without losing anything from A. Almost a
      >> "partial reject changes". Is there such a thing?
      >>
      >> Hope somebody can help.
      >>
      >> Geoff
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Terry Burns

        #4
        Re: RejectChanges problem

        OK then you need two tables as it does not know who made the changes.

        --
        Terry Burns




        "Geoff" <nodamnspam@ema il.com> wrote in message
        news:2PmdnUdIJJ asOnLeRVnysg@pi pex.net...[color=blue]
        > Hi Terry
        >
        > I'm afraid I didn't explain myself too clearly. Basically form A and B
        > have access to a global DataTable. If I make changes to the DataTable in
        > A, enter B and make changes to the DataTable and then press Cancel
        > (calling RejectChanges for the DataTable) I will also reject the changes
        > made in form A - which is not intended i.e. all I want to do by pressing
        > Cancel in form B is to reject the changes made in it.
        >
        > So, what I'm looking for is a way to reject the changes made in form B AND
        > ONLY in form B. RejectChanges seems to clear everything.
        >
        > Can you help?
        >
        > Geoff
        >
        >
        > "Terry Burns" <me@mine.com> wrote in message
        > news:uR54ZcAMGH A.1032@TK2MSFTN GP11.phx.gbl...[color=green]
        >> Yes, make the second form open in Modal, this will prevent you from
        >> accessing form A until you finish with form B.
        >>
        >> --
        >> Terry Burns
        >> http://TrainingOn.net
        >>
        >>
        >> "Geoff" <nodamnspam@ema il.com> wrote in message
        >> news:YqmdnXjAPu B06XLenZ2dnUVZ8 qWdnZ2d@pipex.n et...[color=darkred]
        >>> Hi
        >>>
        >>> Can anybody suggest how to get round the following problem?
        >>>
        >>> I have a form (form A for the sake of argument) which accepts data to be
        >>> put into a DataTable. If the cancel button is pressed, I call
        >>> RejectChanges to prevent the inputted data being passed to the
        >>> DataTable. However, I also have a button on the form which calls another
        >>> form (which I'll refer to as form B) which can also populate the table.
        >>> In this form there is also a cancel button to which I call RejectChanges
        >>> i.e. in order that the data inputted in its form can be rejected.
        >>>
        >>> The problem is this, if the user inputs data in form A, and then enters
        >>> form B and inputs some data, but then decides that the last set of data
        >>> is wrong and presses Cancel then ALL the data is lost i.e. that from A
        >>> and B (where the intention is to only lose that from form B).
        >>>
        >>> Now, I don't want to write any data to the database that the table is
        >>> attached to i.e. I don't want to use Update until the user leaves form A
        >>> (by pressing "OK" or something).
        >>>
        >>> Can you see my problem? What I think I need is some way to say that the
        >>> data in B can be lost but without losing anything from A. Almost a
        >>> "partial reject changes". Is there such a thing?
        >>>
        >>> Hope somebody can help.
        >>>
        >>> Geoff
        >>>
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...