473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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.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
5 1624
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
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
Pavel, Steve
Thank you very much. Me.Undo does work. How very silly of me!
Galina
Nov 12 '05 #4
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: BT3 | last post by:
I am trying to replace a single record in a flat file. The file is relatively small and no need for database. I open the file, and save the ftell() value in a variable. I read a record using...
6
by: DebbieG | last post by:
I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
3
by: pcPirate | last post by:
Hi, I have an application, the user are able to change records in this application. Also, there's a button called "What If". After the user pressed the "What If" button, the user may change...
0
by: Spencer Lee | last post by:
I have encountered a very unique problem (for me): I created a data access page, with 3 levels of groups. I put the file on the web folder (intranet), and it seems like everything is working...
19
by: MaXX | last post by:
Hi, I hope I'm not OT. I have the following issue: I want to delete a record from my db with a php script. Let's say I'm auth'd and I want to delete the record id 440. With a simple form (get...
3
by: CourtGuy | last post by:
Hi Folks, I've got a problem that's been confounding me for months. I work for a criminal court, and I'm trying to set up an Access database to track petitions filed by criminal defendants. ...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
6
by: JHite | last post by:
I'm using Access 2003 with MS XP. Have table/records with FirstName (text field), LastName (text field), plus other fields. User enters FirstName, LastName and other info in form. Before updating...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.