Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / October 2005

Tip: Looking for answers? Try searching our database.

help with canceling dataentry form data...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brook - 15 Oct 2005 07:08 GMT
good day all,

 I have a dataentryform that I use to enter info into a table from a
cbolookup.

On the form I have an "OK" button and a "Cancel" button.

the OK button works fine and accepts the data, however, I for the cancel
button. I want the form to close with accepting any changes that have been
typed into the form fields... how is this possible?

any suggestions?

Thanks,

Brook
John Spencer - 15 Oct 2005 14:32 GMT
If this is a form with no subform, you can use code in the Cancel button's click
event to UNDO the changes and then close the form
Sample (UNTESTED) code

 Me.Undo  '<-- undoes all unsaved changes to the form
 DoCmd.Close acForm, Me.Name

> good day all,
>
[quoted text clipped - 12 lines]
>
> Brook
Brook - 15 Oct 2005 14:58 GMT
good day John,

 I set it up like you suggested, however when I click the close button  I
get a runtime error 2498.

 an Expression you entered is the wrong data type for one of the arguements?

Any ideas?

Thanks for the post.... and suggestions..

Brook

> If this is a form with no subform, you can use code in the Cancel button's click
> event to UNDO the changes and then close the form
[quoted text clipped - 19 lines]
> >
> > Brook
John Spencer - 17 Oct 2005 03:47 GMT
Strange, it works for me.  I just retested it.

What version of Access are you using?  

Did you enter the code exactly as posted?  No substitutions.

> good day John,
>
[quoted text clipped - 32 lines]
> > >
> > > Brook
Brook - 17 Oct 2005 06:49 GMT
Good Day John,

  I had an extra " . " in one of the pieces of code.

 It works fine now.. thanks for the help!

Brook

> Strange, it works for me.  I just retested it.
>
[quoted text clipped - 38 lines]
> > > >
> > > > Brook
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.