My Assistant
![]() ![]() |
|
|
Feb 23 2005, 06:07 AM
Post
#1
|
|
|
New Member Posts: 7 |
Hi all,
Does anyone have code for a button that will close a form and cancel all the data that was input? ie. the equivalent of pressing the ESCAPE key. Thanks! |
|
|
|
Feb 23 2005, 07:07 AM
Post
#2
|
|
|
Utterly Yorkshire and Forum/Wiki Editor Posts: 15,882 From: Devon UK |
Hi
Welcome to Utter Access (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif) In the On Click event of your command button, try Me.Undo Docmd close acForm, Me.Name HTH Alan |
|
|
|
Feb 23 2005, 08:36 AM
Post
#3
|
|
|
New Member Posts: 7 |
Thanks for that.
I ended up figuring out a way of doing it using Sendkeys in a macro, though I think your way is more efficient. Cheers anyway (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif) |
|
|
|
Feb 23 2005, 09:15 AM
Post
#4
|
|
|
Utterly Yorkshire and Forum/Wiki Editor Posts: 15,882 From: Devon UK |
No problem, glad you got it working (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)
Just as a pointer, I know from experience that Access can be very daunting particularly when you first start using it and that it is a very multi-learning environment (structure, naming conventions, relationships, SQL, VBA etc etc) but you would be well advised to start using Visual Basic for Applications (VBA) instead of macros. It's a powerful programming language that is far more flexible than macros, there's lots of things that aren't possible with macros and importantly you can trap and handle errors (amongst other things). You'll find lots of examples of VBA code both here at UA and on the web. Good luck with your project.... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif) HTH Alan |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 19th May 2013 - 10:23 PM |