Computer Learning Zone CLZ Access Excel Word Windows

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand the world. There is no such thing as a dumb question.

-Carl Sagan
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Access >
TechHelp


Back to TechHelp
 

Clarification Needed Please Upload Images   Link  
Sandra Truax 
29 days 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?

Signed,
Confused again :)
Adam Schwanz
29 days ago
I just do Me.Refresh :P or If Me.Dirty=True then Me.Dirty=False
Sandra Truax
29 days ago
Thank you once again Adam! Quick question, which Event do you put the Me.Refresh in?
Adam Schwanz
29 days 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
29 days ago
Maybe something like

Me.Refresh
If Me.Dirty=True Then Cancel=True
'record didn't save for some reason
Sandra Truax
29 days ago
Adam,
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
29 days 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
29 days 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. :)
Add a ReplyUpload an Image


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
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.
 

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
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
amicron@gmail.com
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn