By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.Requery 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
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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:

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.Requery 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

Nov 12 '05 #2

P: n/a
Couldn't you just execute Me.Undo before leaving the record to cancel the new
entry?

On 18 Feb 2004 04:07:05 -0800, ga****@mail.ru (Galina) wrote:
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.Requery 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


Nov 12 '05 #3

P: n/a
Pavel, Steve
Thank you very much. Me.Undo does work. How very silly of me!
Galina
Nov 12 '05 #4

P: n/a
On 19 Feb 2004 01:26:22 -0800, ga****@mail.ru (Galina) wrote:
Pavel, Steve
Thank you very much. Me.Undo does work. How very silly of me!
Galina


No silly questions here. We're glad to help.
Nov 12 '05 #5

P: n/a
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 <no****@nospam.nospam> wrote in message news:<5n********************************@4ax.com>. ..
On 19 Feb 2004 01:26:22 -0800, ga****@mail.ru (Galina) wrote:
Pavel, Steve
Thank you very much. Me.Undo does work. How very silly of me!
Galina


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

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.