if "acCmdLinkedTableManager" opens dialog box, what closes it?

R

Rafi

if in Access 2007 "acCmdLinkedTableManager" opens dialog box of Linked Table
Manager, then what closes it?
 
D

Douglas J. Steele

It gets closed by the user clicking on OK once all of the changes have been
made.

Why would you need to close it programmatically?
 
R

Rafi

Thanks for your reply.

The problem is that combos within one of the forms stoped doing search for
existing data, but the data is visible within the combo list. When you type,
it just doesn't give you marked on screen alphabetically next close to it
line.
All the tables are linked correctly and all the forms and querries are
working fine.
I noticed that to fix this problem all I need is to open the Link Table
Manager dialog
box and then do cancel or ESC without changing nothing,- and everything
works fine
again. I spent almost a week trying to figure out the problem,- but I can't
find anything that would cause it. Then in order to release users from
touching the
data links,- I used the acCmdLinkedTableManager line to open the dialog box
of Linked TAble Manager on Swithchboard Form load. All I need now is to
close
it thru the next VBA line. I tried using Sendkeys "{ESC}",- but it doesn't
work.

Open for any ideas anyone might have....

Thanks,

Rafi
 
D

Dirk Goldgar

Rafi said:
The problem is that combos within one of the forms stoped doing search for
existing data, but the data is visible within the combo list. When you
type,
it just doesn't give you marked on screen alphabetically next close to it
line.

I don't understand your description of the problem. Could you explain it
again, please, using different words?
I noticed that to fix this problem all I need is to open the Link Table
Manager dialog
box and then do cancel or ESC without changing nothing,- and everything
works fine
again. I spent almost a week trying to figure out the problem,- but I
can't
find anything that would cause it. Then in order to release users from
touching the
data links,- I used the acCmdLinkedTableManager line to open the dialog
box
of Linked TAble Manager on Swithchboard Form load. All I need now is to
close
it thru the next VBA line. I tried using Sendkeys "{ESC}",- but it
doesn't
work.

Theoretically, I guess you could use Windows API code to loop through all
the open windows, find that dialog window, and send a WM_CLOSE message to
it. However, the Linked Table Manager dialog is modal, so any code lines
following RunCommand acCmdLinkedTableManager will not execute until the
dialog is closed. You could probably open a form with a Timer event, before
opening the Linked Table Manager, and have the form's Timer event run the
code to identify the dialog window and close it.

That said, it seems a really convoluted, kludgey workaround for the problem.
If this is a bug in A2007 that needs a workaround, I'd be looking for a
better one than this. Does simply hiding and redisplaying the offending
form fix the problem? How about moving it?
 

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