G
Guest
Hi. I have a form and then a subform in it, whose values are based off the
information in the form (somehow, which the wizard did).
I have a button to delete a record from the subform, which works fine.
However, I want to have a button to delete a record from the form. The
problem with this is that the corresponding records lower in the
hierarchy/inheritance (the ones on the subform) need to be deleted first.
The subform is not based off of some sort of query, instead, this is its
record source: SELECT [tbl Dealer Staff Title].[Dealer Title Staff ID], [tbl
Dealer Staff Title].[Dealer Title ID] AS [tbl Dealer Staff Title_Dealer Title
ID], [tbl Dealer Staff Title].[Dealer Staff ID], [tbl Dealer Titles].[Dealer
Title ID] AS [tbl Dealer Titles_Dealer Title ID], [tbl Dealer Titles].[Dealer
Title], [tbl Dealer Titles].[Dealer Title Importance] FROM [tbl Dealer
Titles] INNER JOIN [tbl Dealer Staff Title] ON [tbl Dealer Titles].[Dealer
Title ID]=[tbl Dealer Staff Title].[Dealer Title ID];
Is there a way in VBA to go through the subform and delete each record (if
there are records) and then subsequently delete the main record. The last
part is easy, it is just that I am not sure, first of all, how to determine
how many records there are (or I could use come kind of while loop with some
kind of condition). The other problem is that is there a way to bypass the
“are you sure you want to delete this†so that instead it is just deletes all
lower records instantly?
Thanks, I’d appreciate any help, I am sorry I cannot be any clearer, I am
very new to Access.
information in the form (somehow, which the wizard did).
I have a button to delete a record from the subform, which works fine.
However, I want to have a button to delete a record from the form. The
problem with this is that the corresponding records lower in the
hierarchy/inheritance (the ones on the subform) need to be deleted first.
The subform is not based off of some sort of query, instead, this is its
record source: SELECT [tbl Dealer Staff Title].[Dealer Title Staff ID], [tbl
Dealer Staff Title].[Dealer Title ID] AS [tbl Dealer Staff Title_Dealer Title
ID], [tbl Dealer Staff Title].[Dealer Staff ID], [tbl Dealer Titles].[Dealer
Title ID] AS [tbl Dealer Titles_Dealer Title ID], [tbl Dealer Titles].[Dealer
Title], [tbl Dealer Titles].[Dealer Title Importance] FROM [tbl Dealer
Titles] INNER JOIN [tbl Dealer Staff Title] ON [tbl Dealer Titles].[Dealer
Title ID]=[tbl Dealer Staff Title].[Dealer Title ID];
Is there a way in VBA to go through the subform and delete each record (if
there are records) and then subsequently delete the main record. The last
part is easy, it is just that I am not sure, first of all, how to determine
how many records there are (or I could use come kind of while loop with some
kind of condition). The other problem is that is there a way to bypass the
“are you sure you want to delete this†so that instead it is just deletes all
lower records instantly?
Thanks, I’d appreciate any help, I am sorry I cannot be any clearer, I am
very new to Access.