I'm stumped, I have a form with its pop up/modal properties both set to "yes", this form is opened in response to a "Search" command button on the primary form (DoCmd.OpenForm "frmSearch" ); after all code executes within the Search form it is coded to close without save (DoCmd.Close acForm, "frmSearch" , acSaveNo) the primary form remains loaded in the background througout. Here is the problem, the search form closes sometimes and then at other times remains open as a "ghost" image (cannot be interacted with), I have to go to task manager to kill the MSAccess process to get rid of it. Any help would be appreciated in figuring out why this form will not close; I've ensured that all record sets are set to nothing as this was in other posts as a possible reason.
Why does modal form remains visible?
Collapse
X
-
Have you got any Application.Ech o or DoCmd.Echo commands set to False not set back to True at any material time?I'm stumped, I have a form with its pop up/modal properties both set to "yes", this form is opened in response to a "Search" command button on the primary form (DoCmd.OpenForm "frmSearch" ); after all code executes within the Search form it is coded to close without save (DoCmd.Close acForm, "frmSearch" , acSaveNo) the primary form remains loaded in the background througout. Here is the problem, the search form closes sometimes and then at other times remains open as a "ghost" image (cannot be interacted with), I have to go to task manager to kill the MSAccess process to get rid of it. Any help would be appreciated in figuring out why this form will not close; I've ensured that all record sets are set to nothing as this was in other posts as a possible reason. -
I suppose you could try making the form invisible then closing it:
Forms("frmSearc h").Visible = False
DoCmd.Close acForm, "frmSearch"
If the form is apt to be opened again before the app is closed, in it's Form_Load event make sure it's visible again
Forms("frmSearc h").Visible = True
BTW, I'm guessing that you think that bold argument
DoCmd.Close acForm, "frmSearch" , acSaveNo
refers to not saving a record, but in fact it refers to not saving design changes to the form.
Welcome to Bytes!
Linq ;0)>Comment
-
I actually tried that with no success. I've even resorted to using the following code which also fails; it seems like the form is visible on my desktop but Access doesn't even recognize the form is loaded/visible - you can't interact with it and oddly enough if you click on the Search button on the primary form another instance opens and will close but the ghost of the original form remains; the only recourse is to end the process via task manager.I suppose you could try making the form invisible then closing it:
Forms("frmSearc h").Visible = False
DoCmd.Close acForm, "frmSearch"
If the form is apt to be opened again before the app is closed, in it's Form_Load event make sure it's visible again
Forms("frmSearc h").Visible = True
BTW, I'm guessing that you think that bold argument
DoCmd.Close acForm, "frmSearch" , acSaveNo
refers to not saving a record, but in fact it refers to not saving design changes to the form.
Welcome to Bytes!
Linq ;0)>
DoCmd.Close acForm, "frmSearch" , acSaveNo
If CurrentProject. AllForms("frmSe arch").IsLoaded Then
MsgBox ("frmSearch is still loaded, need to close it")
DoCmd.Close acForm, "frmSearch" , acSaveNo
End IfComment
-
I guess the next thing I'd try (after making a back up copy of your file) would be to
- Create a new, blank database
- Import all objects from your original database into the new database
- Delete the original database
- Rename your new database to the original database name
and see if that solves the problem.
Linq ;0)>Comment
-
After copying everything over to a new accdb it still remains open as a "ghost" image; I'm not reall saavy on PC specs but I'm wondering if it's related to RAM the PC I'm using has 1.87 GB.I guess the next thing I'd try (after making a back up copy of your file) would be to
- Create a new, blank database
- Import all objects from your original database into the new database
- Delete the original database
- Rename your new database to the original database name
and see if that solves the problem.
Linq ;0)>Comment
-
Don't know what else to suggest, except to delete and recreate the form, assuming that it's corrupted. Have been looking and can't find any other reports of this problem, and don't run 2007 so I can't try to recreate your problem.
Linq ;0)>Comment
Comment