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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Esc key press

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jon - 15 Jan 2008 00:51 GMT
Hi

How do I get access to press the ESC button when someone presses a button on
a form?

Thanks

Jon
Tom van Stiphout - 15 Jan 2008 01:39 GMT
What do you REALLY want to accomplish? There might be better ways.
-Tom.

>Hi
>
[quoted text clipped - 4 lines]
>
>Jon
jon - 15 Jan 2008 02:06 GMT
Hi Tom

When I load a form I automatically fill in some field but if the user close
the form but does not want the values saved, unless he removes the values
they are saved to the record, but if you press the esc key these values are
removed so the form can be closed with out the changes. So if I can simulate
pressing the ESC key before closing the form it would be handy.
I know it is not fool proof by any means but it is ok for what I need.

Jon

> What do you REALLY want to accomplish? There might be better ways.
> -Tom.
[quoted text clipped - 8 lines]
>>
>>Jon
Tom van Stiphout - 15 Jan 2008 02:52 GMT
Thanks.  Actually, you would have to press ESC twice: once to clear
the current field, again to clear the current record.

A great alternative is RunCommand acCmdUndo.  The button wizard can
write the code for you.

-Tom.

>Hi Tom
>
[quoted text clipped - 19 lines]
>>>
>>>Jon
jon - 15 Jan 2008 03:14 GMT
tried that in the past and it did not work.
Using access 97 so that is part of the problem.
Jon

> Thanks.  Actually, you would have to press ESC twice: once to clear
> the current field, again to clear the current record.
[quoted text clipped - 31 lines]
>>>>
>>>>Jon
jon - 15 Jan 2008 03:18 GMT
Thanks Tom I shall now eat my words
sorted

Thanks
Jon

> tried that in the past and it did not work.
> Using access 97 so that is part of the problem.
[quoted text clipped - 35 lines]
>>>>>
>>>>>Jon
jon - 15 Jan 2008 06:11 GMT
Hi Tom

No it not quite right I think being able do simulate a press of the Esc key
would be better.

Jon

> Thanks Tom I shall now eat my words
> sorted
[quoted text clipped - 42 lines]
>>>>>>
>>>>>>Jon
Tom van Stiphout - 15 Jan 2008 13:41 GMT
If you REALLY must, check out the SendKeys function. Note: this is a
last resort, not a first.

-Tom.

>Hi Tom
>
[quoted text clipped - 49 lines]
>>>>>>>
>>>>>>>Jon
John W. Vinson - 15 Jan 2008 17:30 GMT
>Hi Tom
>
>No it not quite right I think being able do simulate a press of the Esc key
>would be better.

Me.Undo will erase all the user's changes to the form, restoring it to the
state where the user first touched the form.

Me.Controlname.Undo will undo changes to an individual control (equivalent to
the user pressing the Esc key once).

            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



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