AllExperts > Visual Basic 
Search      
Visual Basic
Volunteer
Answers to thousands of questions
 Home · More Visual Basic Questions · Answer Library  · Encyclopedia ·
More Visual Basic Answers
Question Library

Ask a question about Visual Basic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Robert Nunemaker
Expertise
String manipulation, Database access and usage, Class creation, and encapsulation are my strong suits. Active X Controls and DLL`s also. Although I don`t deal with Crystal - frankly because I don`t like it; I prefer to do things manually.

Experience
Employment history: Programmed with the Air Force for 15 years, and have continued in the private sector for the past 1 year. Used VB (all versions) for the past 8 years.

Organizations: MCP and MCSD certified.

Education: Computer Science Bachelor degree.

Awards: MCP and MCSD certified.

 
   

You are here:  Experts > Computing/Technology > Basic > Visual Basic > VB in MS Access

Visual Basic - VB in MS Access


Expert: Robert Nunemaker - 2/9/2007

Question
Hi there,

would you be able to give me the code i could use in MS Access so when someone edits the data and tries to close the form, then an error message is displayed asking the user whther would they like to save or not.

Yes = form saved
no = form not saved
cancel = takes back in the form.

Could you give me the VB code for this?

Thanks

Answer
This is actually a very difficult thing in Access because they've tried to do it all for you.  So when you close, any uncommitted changes are automatically saved.  The only way to cut that off at the pass is to put code in the BeforeUpdate event for the form and ask to confirm everytime.

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.