Close Problem

  • Thread starter Thread starter DavidW
  • Start date Start date
D

DavidW

I am trying to display a form on close for reminders and it wont let the
form display

The docmd.open form ("reminders") is on the first line of code in the close
event.
The form is a popup and is set to modal
What have I done wrong?
 
Is that the actual syntax you are using??
Try
DoCmd.OpenForm "reminders", acNormal, , , , acDialog
 
DavidW said:
I am trying to display a form on close for reminders and it wont let the
form display

The docmd.open form ("reminders") is on the first line of code in the close
event.
The form is a popup and is set to modal
What have I done wrong?

Is the above exactly what you have in your code? It should be...

DoCmd.OpenForm "reminders"
 
here are some posibilities:

if the entire instance of Access is being closed, then the
form wont get to be displayed, because Access will close it

if you are trying to open the form from its own Close
event, i dont think that would work

as other have mentioned, the syntax of the line you posted
is incorrect.

it's possible, although i think unlikely from what you
have said, that another pop-up window is being placed
overtop

instead of opening the reminders form, and then letting
the close continue, try canceling the close. have some
boolean value somewhere that marks whether reminders have
been displayed yet.

For Example:

Private RemindersDone as Boolean

Private Sub OnClose(Cancel As Integer)
on error resume next
If Not RemindersDone Then
Cancel = True
DoCmd.OpenForm "Reminders"
end if
end sub

Public Sub SetRemindersDone( Optional b as Boolean = True )
on error resume next
RemindersDone = b
end sub

---------------------

RemindersForm:

Private Sub Form_Load()
on error resume next
Forms!MyOtherForm.SetRemindersDone()
End Sub
 
My Syntax was wrong in my post but not in my form.
I think my problem is like what Dave posted, I am quiting the program and
therefore access is closing the form. After reading what he posted that got
me going in the direction that I needed. Thanks for the responses.
 
Back
Top