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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Verify Field Entry with Chance to Delete Record
Tom Juric 
     
7 months ago
I have a form with a Sub form. I want to verify that all fields in the sub form have an entry. If field is empty or null, I want to give the user the option to either go back to field and enter data OR let the user DELETE the record (in case he made a mistake)

I have code that will check the fields, but I am not sure how to send the user back to fill it NOR how to give user a chance to delete the record. This code is placed in the  BeforeClose event of the main form.

Can anyone point me in the right direction?

I have a picture of the form with notes but cannot determine how to attach the picture

Tom Juric OP  @Reply  
     
7 months ago

Raymond Spornhauer  @Reply  
          
7 months ago
Tom

You can make these fields "Required" in the Table.  This will prevent the record from being created without these fields.

Other Method:
Set your subform details section allowadditions to False, then use unbound fields on this form, or another form, then add the record with code or SQL after checking all the fields have data.

-Raymond
Sandra Truax  @Reply  
         
7 months ago
You could try this

In the forms "Before Update Event"

If IsNull (FirstName) Then
    MsgBox "Must enter first name"
    Cancel = True
End if

Required
Tom Juric OP  @Reply  
     
7 months ago
Thanks for all the help.  I ended up saving the records to a Temp table and when the form is closed user gets a chance to save
Kevin Yip  @Reply  
     
7 months ago
BeforeUpdate is how this is usually done, like Sandra said.  If the entry is not valid, the user cannot leave the record until it's valid.  And the user simply needs to press Esc to cancel out (i.e. delete) the entry.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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:20:28 PM. PLT: 1s