Close Problem

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?
 
G

Guest

Is that the actual syntax you are using??
Try
DoCmd.OpenForm "reminders", acNormal, , , , acDialog
 
R

Rick Brandt

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"
 
D

Dave Cousineau

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
 
D

DavidW

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top