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
Gary Orros 
     
3 years ago
Hi Everyone,

I've been stuck again for ages but just can't this to work and hoping someone could help me again.

I know the general rule with deleting records and why it's not advised but as some may know I'm building a database for me to hold lock and information. If the lock gets replaced or changed there is no need to hold the records or key count anymore so I would like to have a button on the edit cylinder form (AdminCylinderEditF) that will allow me to delete the record.

I have a customer form (AdminCustomerResF) with a subform that holds the cylinder details (SubFormAdminCylinderRES). From the subform, I have a button that loads an edit Cylinder details form (AdminCylinderEditF). Then on that form, I have a delete button that is visible when in edit mode.
When you press the delete button, after the form closes the record is deleted but I can't get the subform to requery and the deleted record still shows until I leave the current record and then come back.

If I use that button and VBA code on the Subform rather than the edit cylinder form it works fine with an afterupdate me.requery code.

My only issue with this is that it is very easy to delete the wrong record with the record selector and a list. I think I really need to have a form you have to load, then press edit, then delete. I feel this is a safer option.

My delete VBA is
If MsgBox("Are You Sure You Want To Permatley DELETE Cylinder", vbYesNoCancel) <> vbYes Then Exit Sub
    
    On Error Resume Next
    CurrentDb.Execute "DELETE FROM CylinderT WHERE CylinderID=" & CylinderID
    DoCmd.Close

Any help or a nudge in the right direction would be greatly received.

Thanks Gary
Gary Orros OP  @Reply  
     
3 years ago
Last time I never gave enough info, hope I haven't given to much this time
Kevin Robertson  @Reply  
          
3 years ago
Hi Gary,

Those images are way too small. Can't make out anything.
Gary Orros OP  @Reply  
     
3 years ago
Ok, will delete and try again
Gary Orros OP  @Reply  
     
3 years ago
Ok, can't seem to get the picture any better quality with screen shot, will have to look at it a different way and have another go tomorrow
Kevin Robertson  @Reply  
          
3 years ago
I usually use Paint 3D to resize my images. It's quick and easy.

   - With your image load in Paint 3D select Canvas.
   - Make sure the 'Resize image with canvas' checkbox is checked.
   - Use the resizing handles to resize your image.
   - I usually save my images as JPEGs.
Kevin Robertson  @Reply  
          
3 years ago

Gary Orros OP  @Reply  
     
3 years ago
Cool, thanks Kevin that's really helpful will give this a go
Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago

Gary Orros OP  @Reply  
     
3 years ago
I finally figured it out by using delete buttons with me.requery VBA in them.
I was trying to requery the SubForm directly instead of the main Customer Form

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 9:01:37 AM. PLT: 1s