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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|