Computer Learning Zone CLZ Access Excel Word Windows

One of the basic rules of the universe is that nothing is perfect. Perfection simply doesn't exist. Without imperfection, neither you nor I would exist.

-Stephen Hawking
Home   Courses   Seminars   Templates   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > TechHelp > Access >

Back to TechHelp

Clarification Needed Please Upload Images   Link  
Sandra Truax 
10 months ago
In my notes, to make sure the record is saved before closing, I have

Put DoCmd.RunCommand acCmdSaveRecord in the Deactivate Event

AND I have

Put DoCmd.Save in the Unload Event.

Which is better, and why?

Confused again :)
Adam Schwanz
10 months ago
I just do Me.Refresh :P or If Me.Dirty=True then Me.Dirty=False
Sandra Truax
10 months ago
Thank you once again Adam! Quick question, which Event do you put the Me.Refresh in?
Adam Schwanz
10 months ago
No problem, unless you have some kind of error catching stopping the error, it's going to save when you close it. If it can't, it will tell you that it can't because of whatever. So I don't usually do that. I might put it in a field that needs to save right away, like our serial number field, when they put one from stock into a sold record it needs to come out of stock immediately so two people don't try to snag the same one, so it does me.refresh in those after update events. I suppose if I was going to use it near the end, it would be in like a "close" button. Putting it in a closing event seems kind of pointless because you're telling it to save the record and that is what it was already doing when it was closing. I guess if you wanted to put it somewhere in there anyways though, probably the unload event?
Adam Schwanz
10 months ago
Maybe something like

If Me.Dirty=True Then Cancel=True
'record didn't save for some reason
Sandra Truax
10 months ago
Sounds like I'm either worrying about stuff I don't need to, or just looking for a reason to use VBA.  I have learned so much and love it.  Thanks to you and the others helping when I'm not sure.  Hope you have a wonderful and blessed day. You're awsome!
Kevin Yip
10 months ago
How and when to save depends on what kind of user interface you want to give your users.  If you look at many of today's commercial software, a user entry is often saved *the moment* the user makes the entry.  There may be an Undo button, but there is no "Save" button like in the old days.  If your users are used to that, they may expect or want your forms to behave that way.  In a typical Access operation, if a user edits a form and stays on the form, he may not realize the form isn't saved until he either goes to another record on the form or closes the form.  So to design a proper user interface, you need to understand your users first.
Sandra Truax
10 months ago
Thanks Kevin, for the clarification. That makes a lot of sense and clearer. Thanks for taking time to help me. You're awsome also! I used to think I was pretty good at programming, but now realize I don't know diddly squat! But I'm learning a little more each day. :)

This thread is now closed. If you wish to comment, start a NEW discussion, below.

Back to TechHelp Comments

Start a NEW Conversation
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
Subscribe to TechHelp
Get notifications when this page is updated

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

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

Copyright 2023 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/24/2023 8:01:33 PM.