PC Review


Reply
Thread Tools Rate Thread

Close Form after certain event happens

 
 
=?Utf-8?B?R2lsYmVydCAyMDk3?=
Guest
Posts: n/a
 
      13th Oct 2005
In Access 2003 I have several forms in different applications that I want to
close after I have entered certain data or completed some task. For
instance, I have an emergency shelter where residents come in and I enter all
there data and leave the OutDate blank until they leave. Then I have a form
to enter the OutDates which is filtered to show only the Null OutDates
(usually about 9 or 10 records). After I have entered the last OutDate I
would like the form to close automatically. I know it's kind of petty but I
like to eliminate keystrokes or mouse points as much as I can; and I have
several forms I'd like to do similarly. I hope you understand what I'm
trying to do. I've tried putting the DoCmd.Close "NameOfForm" in an event
procedure, such as AfterUpdate, but I get an error( you can't close a form
while you're in an event procedure). What is the best way to close a form in
this manner? Thanx
--
Gil
 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      13th Oct 2005
Gilbert

How do you (and how will Access) know which is the "last OutDate"?

If I were trying to close a form from within another control on that form,
I'd probably:
1. create a <Close> command button, in which I closed the form
2. call that procedure from the other control, with something like: Call
cmdClose_Click()

--
Regards

Jeff Boyce
<Office/Access MVP>

"Gilbert 2097" <(E-Mail Removed)> wrote in message
news:489CDB38-89C3-435D-B5D2-(E-Mail Removed)...
> In Access 2003 I have several forms in different applications that I want

to
> close after I have entered certain data or completed some task. For
> instance, I have an emergency shelter where residents come in and I enter

all
> there data and leave the OutDate blank until they leave. Then I have a

form
> to enter the OutDates which is filtered to show only the Null OutDates
> (usually about 9 or 10 records). After I have entered the last OutDate I
> would like the form to close automatically. I know it's kind of petty but

I
> like to eliminate keystrokes or mouse points as much as I can; and I have
> several forms I'd like to do similarly. I hope you understand what I'm
> trying to do. I've tried putting the DoCmd.Close "NameOfForm" in an event
> procedure, such as AfterUpdate, but I get an error( you can't close a form
> while you're in an event procedure). What is the best way to close a form

in
> this manner? Thanx
> --
> Gil


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close Form Event PeterM Microsoft Access 4 6th Jun 2010 04:18 AM
Form close event Anand Kale Microsoft Dot NET Compact Framework 1 2nd Nov 2007 12:13 PM
Form.Closing event not fired always when i call Form.Close method berylwilson Microsoft Dot NET Framework Forms 1 20th Apr 2007 02:11 AM
Proper way to close a form in the Form Load event robert d via AccessMonster.com Microsoft Access Form Coding 2 15th Jan 2006 01:58 AM
Form On-Close event Johnb Microsoft Access 1 20th Oct 2004 02:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:31 PM.