I'd like to get rid of new record so that user doesn't notice it.

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

    I'd like to get rid of new record so that user doesn't notice it.

    Hello
    A have an application in MS Access 2000. It has a form (courses),
    which has a subform (course occurrences), which has a subform
    (occurrence learning aims).
    The Learning aims subform is based on a table with a composite primary
    key of course code ID, occurrence ID, learning aim code and year code.
    The table also has got a column Deleted (Yes/No): learning aims
    deleted by users are not deleted from the table, but marked
    Deleted=Yes.
    The subform has got a button New Learning Aim - to add more learning
    aims to the occurrence. The button navigates the subform to a new
    record and user enters learning aim code and year code.
    When there is no primary key violation, it works OK, but sometimes
    user wants to add a learning aim, which already exists in the table
    marked as deleted. What I'd like to do in this situation is to mark
    the learning aim Deleted=No and to switch to this record on the
    subform.
    I have managed to mark the learning aim Deleted=No, but the subform
    still shows the new record. I tried to insert a command
    me.Parent.Reque ry to requery the occurrence subform, which should have
    included the newly undeleted learning aim and to show it on the
    learning aim subform, but naturally I have got here error 3022. I
    intercept it and don't show, but the subform is not requered and user
    still looks at the new record, empty apart from learning aim code and
    year code. Worse, when user leaves the subform, 3022 error message
    shows in all beauty and doesn't allow to close the form normally.
    After the form is closed and opened again, the learning aim is
    restored from deleted and included on the subform, - the result, which
    I'd like to get without seeing 3022 error message and forceful closing
    and opening of the form.
    Any advice would be greatly appreciated.
    Thank you.
    Galina
  • Pavel Romashkin

    #2
    Re: I'd like to get rid of new record so that user doesn't notice it.

    I think the only thing you need to add to your subform error trapping
    code is

    Me.Undo

    where Me refers to the subform, to get rid of the repeatedly entered record.
    Hope this helps,
    Pavel

    Galina wrote:[color=blue]
    >
    > Hello
    > A have an application in MS Access 2000. It has a form (courses),
    > which has a subform (course occurrences), which has a subform
    > (occurrence learning aims).
    > The Learning aims subform is based on a table with a composite primary
    > key of course code ID, occurrence ID, learning aim code and year code.
    > The table also has got a column Deleted (Yes/No): learning aims
    > deleted by users are not deleted from the table, but marked
    > Deleted=Yes.
    > The subform has got a button New Learning Aim - to add more learning
    > aims to the occurrence. The button navigates the subform to a new
    > record and user enters learning aim code and year code.
    > When there is no primary key violation, it works OK, but sometimes
    > user wants to add a learning aim, which already exists in the table
    > marked as deleted. What I'd like to do in this situation is to mark
    > the learning aim Deleted=No and to switch to this record on the
    > subform.
    > I have managed to mark the learning aim Deleted=No, but the subform
    > still shows the new record. I tried to insert a command
    > me.Parent.Reque ry to requery the occurrence subform, which should have
    > included the newly undeleted learning aim and to show it on the
    > learning aim subform, but naturally I have got here error 3022. I
    > intercept it and don't show, but the subform is not requered and user
    > still looks at the new record, empty apart from learning aim code and
    > year code. Worse, when user leaves the subform, 3022 error message
    > shows in all beauty and doesn't allow to close the form normally.
    > After the form is closed and opened again, the learning aim is
    > restored from deleted and included on the subform, - the result, which
    > I'd like to get without seeing 3022 error message and forceful closing
    > and opening of the form.
    > Any advice would be greatly appreciated.
    > Thank you.
    > Galina[/color]

    Comment

    • Steve Jorgensen

      #3
      Re: I'd like to get rid of new record so that user doesn't notice it.

      Couldn't you just execute Me.Undo before leaving the record to cancel the new
      entry?

      On 18 Feb 2004 04:07:05 -0800, galkas@mail.ru (Galina) wrote:
      [color=blue]
      >Hello
      >A have an application in MS Access 2000. It has a form (courses),
      >which has a subform (course occurrences), which has a subform
      >(occurrence learning aims).
      >The Learning aims subform is based on a table with a composite primary
      >key of course code ID, occurrence ID, learning aim code and year code.
      >The table also has got a column Deleted (Yes/No): learning aims
      >deleted by users are not deleted from the table, but marked
      >Deleted=Yes.
      >The subform has got a button New Learning Aim - to add more learning
      >aims to the occurrence. The button navigates the subform to a new
      >record and user enters learning aim code and year code.
      >When there is no primary key violation, it works OK, but sometimes
      >user wants to add a learning aim, which already exists in the table
      >marked as deleted. What I'd like to do in this situation is to mark
      >the learning aim Deleted=No and to switch to this record on the
      >subform.
      >I have managed to mark the learning aim Deleted=No, but the subform
      >still shows the new record. I tried to insert a command
      >me.Parent.Requ ery to requery the occurrence subform, which should have
      >included the newly undeleted learning aim and to show it on the
      >learning aim subform, but naturally I have got here error 3022. I
      >intercept it and don't show, but the subform is not requered and user
      >still looks at the new record, empty apart from learning aim code and
      >year code. Worse, when user leaves the subform, 3022 error message
      >shows in all beauty and doesn't allow to close the form normally.
      >After the form is closed and opened again, the learning aim is
      >restored from deleted and included on the subform, - the result, which
      >I'd like to get without seeing 3022 error message and forceful closing
      >and opening of the form.
      >Any advice would be greatly appreciated.
      >Thank you.
      >Galina[/color]

      Comment

      • Galina

        #4
        Re: I'd like to get rid of new record so that user doesn't notice it.

        Pavel, Steve
        Thank you very much. Me.Undo does work. How very silly of me!
        Galina

        Comment

        • Steve Jorgensen

          #5
          Re: I'd like to get rid of new record so that user doesn't notice it.

          On 19 Feb 2004 01:26:22 -0800, galkas@mail.ru (Galina) wrote:
          [color=blue]
          >Pavel, Steve
          >Thank you very much. Me.Undo does work. How very silly of me!
          >Galina[/color]

          No silly questions here. We're glad to help.

          Comment

          • Galina

            #6
            Re: I'd like to get rid of new record so that user doesn't notice it.

            Steve
            It was actually silly. I do use Me.Undo: to cancel changes to an
            existing record. It was the first thing, which I thought about, when
            started sorting the problem. But instead of trying it, I casually
            asked a colleguae, and he said: "No, you cannot use Me.Undo on a new
            record" and I believed it and spent half-day coding and wrote my
            message to the ng and all these I would have avoided, if I started my
            coding using Me.Undo without asking anyone. It was silly.
            Always greatful for your help.
            Galina
            Steve Jorgensen <nospam@nospam. nospam> wrote in message news:<5no930tjf 6pepbolbnf4ldm1 du66d756uv@4ax. com>...[color=blue]
            > On 19 Feb 2004 01:26:22 -0800, galkas@mail.ru (Galina) wrote:
            >[color=green]
            > >Pavel, Steve
            > >Thank you very much. Me.Undo does work. How very silly of me!
            > >Galina[/color]
            >
            > No silly questions here. We're glad to help.[/color]

            Comment

            Working...