Cascade delete to reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new to Access and completing a database for a college course. We were
given a basic database and asked to expand on it. The database is for
booking conference facilities and is now about 99% complete. I am having
problems however with a delete option.
I have a Booking Details Form which has a Resources Subform. I have added a
delete record button (event procedure) on the subform to delete whichever
resource (there can be more than one resource for each booking number) is
selected. This delete seems to work and removes the entry from all related
tables.
My problem is that once I run the report i.e.Invoice Report, the customer is
being charged for the deleted resources (room, food or equipment) as well as
the current ones.
Please can someone help as this is driving me mad!!
Thanks you very much.
 
A <Delete> button only does what you tell it to. What does your <Delete>
button do (i.e., what're the SQL statements behind the button)?

A report only collects/displays what you tell it to. What does your report
report on (i.e., what's the SQL of the query that underlies your report)?

Without a better understanding of what you actually have built, this is only
a guess...

Perhaps the <Delete> isn't removing items from a table, but only marking
them as "no longer active". Then, perhaps your report's query isn't
checking to see if the item has been set "no longer active"...

Without more information, I can only guess...
 
Jeff, thanks for your reply. As I am new to acces I am not sure what you
mean. Is it possible for me to send you the database?
 
As a volunteer, I really don't have time to investigate and research in your
database. And the newsgroup protocol frowns on attachments.

So, how did you create a <delete> button? Can you open the code "behind the
form" to see what it is doing?

How did you create your report? Based on a query or on a table?
 
The delete button was created with a command button using the wizard. I can
open the code but it might as well be in Japanese as I don't understand it!
But I think this is the bit.

Private Sub Delete_the_last_record_Click()
On Error GoTo Err_Delete_the_last_record_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Delete_the_last_record_Click:
Exit Sub

Err_Delete_the_last_record_Click:
MsgBox Err.Description
Resume Exit_Delete_the_last_record_Click

End Sub

The report is based on a query.

Can you help?
Many, many thansk for your time.
 
If you open the query in design mode and select the SQL view of the query,
you can copy that and paste that into another post to the newsgroup.

Without some idea of your data structure, and how your tables may be
related, and which tables are joined in your report's query, and with your
description of your current level of experience, it may be fairly difficult.

Some folks will accept an email and a database from someone they haven't
met. You may wish to consider re-posting and asking again if someone has
time to take a look at your database...
 
Back
Top