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 / July 2005

Tip: Looking for answers? Try searching our database.

How do I "Escape" data add mode?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nelson - 15 Jul 2005 20:56 GMT
Using code, how do I 'hit the escape key' through code when in the data add
mode?

In other words, when you are adding a new record and the record selector
changes from an arrow to a pencil, you can hit the escape key on the
keyboard to cancel adding that new record.  How do I 'hit the escape key' by
using code?

Thanks,
Chris
Andrew Backer - 15 Jul 2005 21:23 GMT
Does SendKeys work in this situation?
Nelson - 15 Jul 2005 21:32 GMT
I thought of that also, but unfortunately it did not work.  There must be a
way to do this!  Does anyone know how?

> Does SendKeys work in this situation?
Rick Brandt - 15 Jul 2005 21:28 GMT
> Using code, how do I 'hit the escape key' through code when in the
> data add mode?
[quoted text clipped - 6 lines]
> Thanks,
> Chris

Me.Undo

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Nelson - 15 Jul 2005 21:38 GMT
Me.Undo did not work either.  Thanks for the try though.  Any other
suggestions?

> > Using code, how do I 'hit the escape key' through code when in the
> > data add mode?
[quoted text clipped - 13 lines]
> to this message.     Send instead to...
> RBrandt    at       Hunter      dot      com
Rick Brandt - 15 Jul 2005 21:47 GMT
> Me.Undo did not work either.  Thanks for the try though.  Any other
> suggestions?

I have used that quite a bit and it has always worked for me.  What event
are you using it in?  Are you sure there isn't something triggering a save
before the Undo line runs?  Once the record is saved it is too late for
Undo.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Wayne Morgan - 15 Jul 2005 21:36 GMT
Hitting the Esc key once will undo the current control. Hitting the Esc key
a second time will Undo the record. The equivalent in code is to tell either
the control or the form to Undo.

Me.ControlName.Undo
or
Me.Undo

Signature

Wayne Morgan
MS Access MVP

> Using code, how do I 'hit the escape key' through code when in the data
> add
[quoted text clipped - 8 lines]
> Thanks,
> Chris
John Vinson - 16 Jul 2005 02:11 GMT
>Using code, how do I 'hit the escape key' through code when in the data add
>mode?
[quoted text clipped - 6 lines]
>Thanks,
>Chris

SendKeys is buggy, unreliable, and AFAIK never worked in this context
anyway.

VBA code with Me.Undo will (as noted elsethread) cancel the current
record *if* it has not already been saved to disk. Note that if you
have a Form with a Subform, the mainform record is saved to disk the
moment you set focus to any control in the subform (and contrariwise,
the subform record will be saved if you set focus to the mainform).

                 John W. Vinson[MVP]    
 
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.