Pop-up Form

G

Geoff

I'm using Access 2000.

I'm opening a pop-up form with the code:
DoCmd.OpenForm "Form_Name", , , , , acDialog

I understand that code execution should be suspended by setting
the WindowMode property to acDialog until the form is closed or
hidden.

The form does not appear and code continues to execute.

What am I doing wrong please?

TIA
Geoff
 
A

Allen Browne

Geoff, is there any chance that the form might already be open (even if not
visible)?

If so, try this before your OpenForm:

If CurrentProject.AllForms("Form_Name").IsLoaded Then
DoCmd.Close acForm, "Form_Name"
End If

If that does not solve the problem, your code may need a decompile.
 
G

Geoff

Allen - Thanks for your reply.

Yes - I hid the pop-up form so the code that opened the form
would continue. I did not then close it (deliberately). The
odd behaviour changed after rebooting but was still unexpected.
I've now recoded and all seems to be OK. (Unfortunately, I've
not kept the code that apparently caused the problem.)

How do you decompile please?

Geoff
 
A

Allen Browne

To decompile, enter something like this at the command prompt while Access
is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact the database.

Make a backup copy of your database first.

Access keeps 2 copies of the code in an MDB:
- the text copy (what you read and edit);
- the binary copy (what actually executes.)
It is possible for these 2 to get out of sync. - a form of corruption.
A decompile solves that by discarding the compiled version.
Access then recreates it from the text version, and the corruption is gone.
 
G

Geoff

Allen - Thanks.
A good tip.
Geoff


Allen Browne said:
To decompile, enter something like this at the command prompt while Access
is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact the database.

Make a backup copy of your database first.

Access keeps 2 copies of the code in an MDB:
- the text copy (what you read and edit);
- the binary copy (what actually executes.)
It is possible for these 2 to get out of sync. - a form of corruption.
A decompile solves that by discarding the compiled version.
Access then recreates it from the text version, and the corruption is gone.
 

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