A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Delete button isn't working



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2010, 03:06 AM posted to microsoft.public.access.forms
gagecres
external usenet poster
 
Posts: 36
Default Delete button isn't working

I added a delete records button to my form. This form also contains a
subform. I've done this with no problems on several other databases. This
time the button deletes the info from the form, but not the table where it is
stored. I don't understand what is going on. Can somebody help?
  #2  
Old January 22nd, 2010, 04:00 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Delete button isn't working

On Thu, 21 Jan 2010 19:06:01 -0800, gagecres
wrote:

I added a delete records button to my form. This form also contains a
subform. I've done this with no problems on several other databases. This
time the button deletes the info from the form, but not the table where it is
stored. I don't understand what is going on. Can somebody help?


Not without seeing the code for the button and knowing more about the tables.
Do you have referential integrity enforced between the table you're trying to
delete from and a child table (the subform's table)? If so you won't be able
to delete the parent record as long as child records exist, unless you have
Cascade Deletes checked on the relationship.
--

John W. Vinson [MVP]
  #3  
Old January 22nd, 2010, 06:04 PM posted to microsoft.public.access.forms
gagecres
external usenet poster
 
Posts: 36
Default Delete button isn't working

Yes, I have referential integrity enforced as well as cascade delete related
records. I've also tried the compact and repair the database, but nothing
was wrong. When I click the delete button, that the wizard helped me create,
the data is removed from the form. But, when I go look at the tables in
which the data is stored, the data for the subform is gone but the data for
the main form is still there.

"John W. Vinson" wrote:

On Thu, 21 Jan 2010 19:06:01 -0800, gagecres
wrote:

I added a delete records button to my form. This form also contains a
subform. I've done this with no problems on several other databases. This
time the button deletes the info from the form, but not the table where it is
stored. I don't understand what is going on. Can somebody help?


Not without seeing the code for the button and knowing more about the tables.
Do you have referential integrity enforced between the table you're trying to
delete from and a child table (the subform's table)? If so you won't be able
to delete the parent record as long as child records exist, unless you have
Cascade Deletes checked on the relationship.
--

John W. Vinson [MVP]
.

  #4  
Old January 22nd, 2010, 06:20 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Delete button isn't working

On Fri, 22 Jan 2010 10:04:01 -0800, gagecres
wrote:

Yes, I have referential integrity enforced as well as cascade delete related
records. I've also tried the compact and repair the database, but nothing
was wrong. When I click the delete button, that the wizard helped me create,
the data is removed from the form. But, when I go look at the tables in
which the data is stored, the data for the subform is gone but the data for
the main form is still there.


Please post your code.
--

John W. Vinson [MVP]
  #5  
Old January 22nd, 2010, 07:25 PM posted to microsoft.public.access.forms
gagecres
external usenet poster
 
Posts: 36
Default Delete button isn't working

It is just a macro:

Condition Action Arguments
OnError Next,
GoToControl
=[Screen].[PreviousControl].[Name]
ClearMacroError
Not [Form].[NewRecord] RunCommand DeleteRecord
[Form].[NewRecord] And Not [Form].[Dirty] Beep
[Form].[NewRecord] And [Form].[Dirty] RunCommand Undo
[MacroError]0 MsgBox
=[MacroError].[Description],Yes, None

"John W. Vinson" wrote:

On Fri, 22 Jan 2010 10:04:01 -0800, gagecres
wrote:

Yes, I have referential integrity enforced as well as cascade delete related
records. I've also tried the compact and repair the database, but nothing
was wrong. When I click the delete button, that the wizard helped me create,
the data is removed from the form. But, when I go look at the tables in
which the data is stored, the data for the subform is gone but the data for
the main form is still there.


Please post your code.
--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.