No matter what I do the database window opens

J

Jeff Conrad

Hi Stan,

The keyword(s) I wanted you to search for was this:

DoCmd.SelectObject

Open a code module and search the entire database
(Edit | Find) for that string (not Switchboard).

This is written for Access 2002, but one other thing to check:
ACC2002: The Database Window Is Displayed When a
Database Is Opened from the Most Recently Used File List
Even After You Clear the "Display Database Window" Check Box
http://support.microsoft.com/?id=304092
 
G

Guest

I tried the steps in the "...Most recently used file... " article but didn't
get success.

I searched under "DoCmd" and found no occurence of "DoCmd.SelectObject", but
four other instances of DoCmd..

DoCmd.GoToRecord acDataForm, Me.Name, acLast
....
DoCmd.Quit
....
DoCmd.OpenForm "RESULTS VIEWER", , , , , , WorkingDir & DataFil & ".xls"

all within forms that are not opened immediately. The startup form contains
one instance...

DoCmd.OpenForm stDocName, acFormDS, , , acFormReadOnly, acDialog

Maybe I should mention another thing now. Originally I do recall using the
switchboard and even found an orphan table entitled "Switchboard" (which I
recently deleted). I thought of exporting all the tables, queries and forms
from the original copy into a new new blank database and did so, but still
got the database window. Perhaps some remnant of the switchboard is creating
this persistent behaviour.
 
J

Jeff Conrad

Humm....quite odd indeed Stan.

At this point I think a decompile is in order.
Here is an explanation of what it does by MVP Allen Browne:The Decompile switch was undocumented in earlier versions of Access, but has
been documented for 3 versions now.

Decompiling may not give the same results as importing into a new database.

In an mdb file, there are 2 copies of the code:
- a text version (what you view and edit);
- a compiled version (what actually runs).

If the database corrupts, these 2 may differ.
Decompiling discards the compiled version.
It then recreates the compiled code from the text version.
The inconsistency is then gone.

If you import from one mdb into a new file, using the same version, Access
may import both the text version and the compiled version exactly as they
were. If the two copies were inconsistent, the new version can therefore
still have the inconsistency. This is not common, but it does happen.

So, the safest procedure would be:
1. Decompile the old mdb.
2. Compact it to get rid of the space used by temp objects and the compiled
code.
3. Import into a new (blank) database. At this point you are importing only
the text version as the compiled version has been discarded.
4. Set your minimal references, and compile.
So to elaborate a little further here is what I would do.

1. Make a backup of your database.

2. Repeat step 1

3. Compact the database:
Tools | Database Utilities | Compact

4. Close Access. Open a command prompt, and enter something like this. It is one line, and include
the quotes:
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\My
Documents\MyDatabase.mdb"

Adjust the syntax for your Access.exe file and file location.

5. Compact the database again to clear it out:
Tools | Database Utilities | Compact

6. Create a new blank database and import everything (including data, menubars, toolbars,
relationships, etc.)

7. Set minimal Relationships needed

8. Turn off Name AutoCorrect

9. Compile your database

10. Compact the new database
Tools | Database Utilities | Compact

11. Set any Startup properties
Tools | Startup

12. Close the database (and Access) and now test everything again.
Does the Database Window still appear?
 
G

Guest

Jeff,

I did try the steps you recommended in full, but have now discovered
something new.

I just brought a colleague knowledgeable in Access over to the computer and
asked him for his quick comments on the problem. This whole escapade may be
a grand waste I'm afraid. The "database window" I have been trying to hide
is in fact the MS Access application window which is the parent of my child
startup dialog; it is not the actual database window containing the lists of
tables, forms, queries... (that has long been hidden from view.)

I am very sorry to have troubled you; it looks like I won't be able to
accomplish what I was trying to do without some other advanced programming
platform, ie. Visual Basic.

I will retreat to the hall of shame now.
 
G

Guest

Jeff,

I found your newsgroup response to "Leo" from November 5 of last year and
that is what I am actually trying to do. So I think I am on track now, but
won't be surprised if I still get flamed or banished.
 
F

Fred Boer

Dear Stan:

I could kick myself! I once spent *hours* trying to hide the database
window - only to find, just as you have, that I was talking about the
application window not the database window. I actually posted about this: If
you do a google groups search with "Just a comment on Hiding database window
question", you can find the original post. I only wish I had paid closer
attention to this thread; I might have been able to save you (and Jeff) some
time!

Anyway, don't worry about the Hall of Shame; it's a friendly place here, and
there are lots of us to keep you company!

Best Wishes!
Fred Boer
 
J

Jeff Conrad

I did try the steps you recommended in full, but have now discovered
something new.

I just brought a colleague knowledgeable in Access over to the computer and
asked him for his quick comments on the problem. This whole escapade may be
a grand waste I'm afraid. The "database window" I have been trying to hide
is in fact the MS Access application window which is the parent of my child
startup dialog; it is not the actual database window containing the lists of
tables, forms, queries... (that has long been hidden from view.)

Ahhhhh, well that *does* make a difference now doesn't it?
:)
I am very sorry to have troubled you; it looks like I won't be able to
accomplish what I was trying to do without some other advanced programming
platform, ie. Visual Basic.

No trouble at all Stan, don't worry about it.
I will retreat to the hall of shame now.

"Let he who has not made a mistake cast the first stone."

<deafening silence>

......notice no sound Stan?

We've all been there before; some more than others.
I filled up my punch card a loooooooong time ago.
;-)
 
J

Jeff Conrad

Jeff,

I found your newsgroup response to "Leo" from November 5 of last year and
that is what I am actually trying to do. So I think I am on track now, but
won't be surprised if I still get flamed or banished.

Hi Stan,

To completely hide the entire Access interface you can use the code found here:

http://www.mvps.org/access/api/api0019.htm

However, heed the warnings as this procedure does have some pitfalls!
I have found this technique to ONLY be useful when needing to interact
with only one form, or at best only a handful of forms. Need to view
reports? Forget it with this technique.

The best thing to do in my opinion is create custom menu bars and toolbars
for your application, hide the Database Window (not application), and create
limited Startup options. Instead of your program looking like an Access
Application, you just make it look like a *Software Application* and
give it a nice polished look.

If you still want to use it and have trouble with setup just post back.
I have written some step-by-step instructions on how to set it up.
 
J

Jeff Conrad

I could kick myself! I once spent *hours* trying to hide the database
window - only to find, just as you have, that I was talking about the
application window not the database window. I actually posted about this: If
you do a google groups search with "Just a comment on Hiding database window
question", you can find the original post. I only wish I had paid closer
attention to this thread; I might have been able to save you (and Jeff) some time!

Anyway, don't worry about the Hall of Shame; it's a friendly place here, and
there are lots of us to keep you company!

Best Wishes!
Fred Boer

LOL!
Yep, Fred and I got our Stars on the Hall of Shame a long time ago.
;-)
 

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