Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access

ResolvedVersion 2010

Stuart has attended:
Access Intermediate course
Access Advanced course
Access VBA course

Access 2010

I have a form with a delete button that refers to 2 tables.
When I delete I want to delete info from both tables.
Please advise.

RE: Access 2010

Hello Stuart,

Thank you for your question regarding adding a delete button which removes the records from both your tables.

Since ID fields in both tables are a match then you must have a primary key field in both tables. First remove any relationships you already have then save and close the relationship window.

Open the table which does not have a primary key and assign the PK to the ID field (Ref) then save and close the table.

Re-open the Relationships window and drag the Ref field across to the Ref field in the other table. Check the 'Enforce Referential Integrity' box and also check 'Cascade Delete Related Records'.

Enter sample data and test.

I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Rodney
Microsoft Office Specialist Trainer

Attached files...

CustomerSales.accdb

RE: Access 2010

That's brilliant Rodney,

Thanks so much!

Access tip:

Display current date & time in column of any width

The worksheet function =NOW() returns the current date & time. When entered into a column which is not wide enough to display the value NOW returns, the cell displays ###

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.