Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Cascade Delete    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Cascade Delete
Halkawt Qadir 
   
10 months ago
Mr. Richard how to achive same result but not for those

( CurrentDb.Execute "DELETE FROM OrderDetailT WHERE OrderID=" & OrderID )
(CurrentDb.Execute "DELETE FROM OrderT WHERE OrderID=" & OrderID)

I just want to delete selected record in the form that i am on it, my field name is Paid which is a Combo box (PaidFromCbo) that contain two selections Paid or Open, ofcourse i want to prevent deleting records that are paid and only allow deletion for those are still open

I asked chatGPT 200 times but he could not rewrite your code properly LOL :), then my instict says go on and ask Richard the smartest man on the palent in Microsoft Access Database.

I appreciate your help,
Raymond Spornhauer  @Reply  
          
10 months ago
You should not be deleting orders from your database.

You should either modify your query to not show orders with no balance, or add a field to the table that you can mark as paid or update with VBA.

-Raymond
Richard Rost  @Reply  
          
10 months ago
I do agree with Raymond that it's best not to delete orders. You should just mark them inactive or something like that. But I do also know sometimes you put an order in by mistake and you do want to just delete it. It would look something like...

In your delete button:

DetailsIf IsPaid Then
   MsgBox "Can't delete a paid order"
   exit sub
end if

CurrentDB.Execute...


and then your two statements you have above. You'll probably then want to close the form when you're finished.
Halkawt Qadir OP  @Reply  
   
10 months ago
Raymond Mr. Raymond we need to delete some charges if entered by mistake or the job is cancelled that is why i need this modification
Raymond Spornhauer  @Reply  
          
10 months ago
Can you post a picture of the form where you're trying to delete the record?

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Cascade Delete.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/1/2026 11:22:25 PM. PLT: 1s