Hide database window (via code)

D

Dale Fye

I've got an application that I'm developing on a Office 2007, Vista computer,
for users running 2003 and 2007 on XP and Vista computers.

When the application refreshes links to the backend data, the NavPane(2007)
and database window (2003) are visible, so I used the following code to
select one of the premanent tables, and then close either the navpane or
database window.

DoCmd.SelectObject acTable, "local_Parameters", True
DoCmd.RunCommand acCmdWindowHide

This morning, one of my 2003(Win XP) users called and indicated that he had
a 2046 error (The command or action 'WindowHide' isn't available now) on the
Runcommand line above.
 
D

Dirk Goldgar

Dale Fye said:
I've got an application that I'm developing on a Office 2007, Vista
computer,
for users running 2003 and 2007 on XP and Vista computers.

When the application refreshes links to the backend data, the
NavPane(2007)
and database window (2003) are visible, so I used the following code to
select one of the premanent tables, and then close either the navpane or
database window.

DoCmd.SelectObject acTable, "local_Parameters", True
DoCmd.RunCommand acCmdWindowHide

This morning, one of my 2003(Win XP) users called and indicated that he
had
a 2046 error (The command or action 'WindowHide' isn't available now) on
the
Runcommand line above.


Dale, are you sure it was an Access 2003 user, not 2007? I was involved in
a recent discussion:

http://groups.google.com/group/micr...ormscoding/browse_frm/thread/302e933d1128e6bf

.... that concluded that the Access 2007 Nav Pane can be configured in such a
way as to cause code like that to fail silently.

If it's really Access 2003, I would expect that code to work, so long as the
table "local_Parameters" exists. Maybe if it's hidden it wouldn't work -- I
haven't tested that. And if the table doesn't exist, I'd expect an error to
be raised, but error-handling could mask that.
 
D

Dale Fye

He said he was using 2003, and none of the people who are using it with 2007
have had any problems. I've put an error handler in that routine, but have
not had a chance to test it on his machine.

I just found this interesting, because I've never seen an error thrown in
that segment of any of my apps.

Thanks for your feedback. I'll take a look at the thread you referred to.
 
D

Dale Fye

Dirk,

I read the other thread. I had what I thought was a similar problem with
one of my 2007 apps right after we migrated to 2007. However, it turned out
that when you link tables programmatically, it makes the nav pane visible
again, so I just had to add a couple of lines of code to hide it again,
after I finished linking tables.

Dale
 

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