Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Delete Button for Order Details
Philip Dirden 
     
13 months ago
Good morning Richard,
I have an add button to add a product to the OrderDetail form and need to have a button for removing it in case it was the wrong product added in error.
Where can I find the instructions for that?
Thank you for the assistance.
Richard Rost  @Reply  
          
13 months ago
I don't think I've made a lesson on how to do that. Usually, you just click the record selector on the left and then press delete. You could make your own button if you want to. I believe one of the command button wizards has a delete record option in there too. You could use that. Maybe I'll add this to the list for a video with an "Are you sure?" option.
Philip Dirden OP  @Reply  
     
13 months ago
Thanks for the quick response!  I used the wizard and tried it and received this message: " The command or action "DeleteRecord isn't available now." What is needed to correct that?
Kevin Robertson  @Reply  
          
13 months ago
Do you have Allow Deletions set to Yes?
    Form Properties -- Data Tab
Philip Dirden OP  @Reply  
     
13 months ago
Thank you Kevin!
Switched it to YES and it works!!!
I knew it was something simple!
Thanks again!
Great commanders make great crews!
To boldly go where no man has gone before.
Richard Rost  @Reply  
          
13 months ago
I don't have a video specific to this so thanks for the idea.
Philip Dirden OP  @Reply  
     
13 months ago
Your welcome!
Next question....After deleting a line, get back to the ProductCombo box?
Thanks in advance !
Alex Hedley  @Reply  
           
13 months ago
.SetFocus()
Philip Dirden OP  @Reply  
     
13 months ago
Thanks Alex,
I'm a bit confused as to where I put that!
Please advise.
Thanks
Kevin Robertson  @Reply  
          
13 months ago
After Del Confirm

Bare in mind, however, this event won't run if you turn your Warnings off.
This is one of the reasons why you are better to create your own Delete Button.
Philip Dirden OP  @Reply  
     
13 months ago
OK good advice!
Where can I find the coding to try that?
Kevin Robertson  @Reply  
          
12 months ago
Here is code for a Delete Button from one of my databases. Modify it to suit your needs.

Private Sub btnDeleteTask_Click()

    If MsgBox("Are you sure you want to DELETE the selected task?" & vbNewLine & vbNewLine & This action CANNOT be undone.", vbYesNoCancel + vbExclamation + vbDefaultButton3, "Confirm Delete") <> vbYes Then Exit Sub
        
    CurrentDb.Execute "DELETE FROM TaskT WHERE TaskID=" & lstTasks
    lstTasks.Requery
    SwitchMode
    
End Sub


You can ignore 'SwitchMode'. That's just a sub in my database to switch between Add and Edit modes.

REMEMBER: Make a BACKUP copy of your database first BEFORE running any code that will change or DELETE data.

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

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/6/2026 10:55:24 AM. PLT: 1s