form pop up

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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...
 
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.
 
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...
 
Back
Top