form pop up

G

Guest

I have the following code what I want is for a form to pop up before the code
runs then close when the code is done running. It does pop up however it
never closes.

Private Sub Command25_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmUpdateDBMsg"
CurrentDb.QueryDefs("qurinmtinfoAppend").Execute dbFailOnError
CurrentDb.TableDefs.Refresh
DoEvents
CurrentDb.QueryDefs("qurOldInmates").Execute dbFailOnError
CurrentDb.TableDefs.Refresh
DoEvents
CurrentDb.QueryDefs("qurDeleteOldInmates").Execute dbFailOnError
CurrentDb.TableDefs.Refresh
DoEvents
DoCmd.SetWarnings True
CurrentDb.TableDefs.Refresh
DoEvents
DoCmd.Close acForm, "frmUdateDBMsg"
End Sub
 
G

Guest

Hey is this my old friend down round Galveston, Texas?
When I saw "Inmates" it made me think of a girl I helped that was building a
database for the Polilce Department down there... Anyway...


What happens if you take out the DoEvents there at the end?

Just go to close the form like:

DoCmd.SetWarnings True
CurrentDb.TableDefs.Refresh
DoCmd.Close acForm, "frmUdateDBMsg"
End Sub
 
G

Guest

Oh and another thing you may try is placing the save variable at the end like:

DoCmd.Close acForm, "frmUdateDBMsg", acSaveNo

I think I remember a form not closing once because that was left off of the
end...
 
G

Guest

thanks i will try this and let you know if ti works, sorry not your friend
from Galviston I am in Pa and work at one of the state prisons here.
 
G

Guest

it worked, thanks so much.

sparker said:
Oh and another thing you may try is placing the save variable at the end like:

DoCmd.Close acForm, "frmUdateDBMsg", acSaveNo

I think I remember a form not closing once because that was left off of the
end...
 

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