Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access coding help matching data and deletion from two linked tables

Posted on 2002-04-12
3
Medium Priority
?
131 Views
Last Modified: 2013-11-27
I have built an access database that uses forms. I am having trouble with trying to delete a piece of data.
The project is a car parking system and in the main screen is portrayed the registration number. when this is clicked a form (car edit form)appears to enable the car details to be changed with the registration number locked ie. not able to be edited but appears on the screen. To sell the car a button is clicked to produce the customer entry form and then the customer details are taken and then the form is closed.
I want to be able to take the registration number from the car edit form and delete it from two linked table the first of which is the space table and the next is the cars table. How do I do this?
0
Comment
Question by:Lyndonbatchelor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
kcm76 earned 600 total points
ID: 6937922
this may help u
have u given cascade delete records in referential integrity, u just delete the record in master table.
like delete * from master_table where registration_number = " & CLng(txtregistration.text)

otherwise, u have to delete it from the detail table first.

delete *
from detail_table, master_table
where detail_table.ForeignKeyField = master_table.PrimaryKeyField and master_table.registration_number = " & Clng(txtregistration.text)

for deleting in the master table, as mentioned earlier,

delete * from master_table where registration_number = " & CLng(txtregistration.text)

ALL THE BEST




0
 
LVL 16

Expert Comment

by:twalgrave
ID: 7755019
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- points to kcm76
Please leave any comments here within the
next seven days.
0
 

Expert Comment

by:SpideyMod
ID: 7812395
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question