Close Form after certain event happens

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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()
 
Back
Top