refreshing project in code

B

bill

What is the command to refresh the project in code so new objects are
available?


I create a view dynamically in code.

I want to open it immediately using DoCmd.OpenView ..., but I get error
7874, Access can't find the object.

When debugging I can open the view after refreshing the project view.

How can I do this programmatically so I can display the new View?
RefreshDatabaseWindow doesn't seem to work, because I still get the error
after executing the command, until I manually refresh the project.


Thanks
Bill
 
S

Sylvain Lafontaine

You can try the Application.RefreshDatabaseWin­dow command, however there
have been reports of problems with this command in the past (for example,
refreshing the Tables collection when it was not the Tables window that was
displayed; necessity of adding a time delay after it and for A2000:
http://support.microsoft.com/default.aspx?scid=kb;en-us;304256 ).

There is also the possibility of using something else than a View in your
project. If you are recreating it each time, I don't see its necessity.
 
B

bill

Thank you.
-Bill

Sylvain Lafontaine said:
You can try the Application.RefreshDatabaseWin­dow command, however there
have been reports of problems with this command in the past (for example,
refreshing the Tables collection when it was not the Tables window that was
displayed; necessity of adding a time delay after it and for A2000:
http://support.microsoft.com/default.aspx?scid=kb;en-us;304256 ).

There is also the possibility of using something else than a View in your
project. If you are recreating it each time, I don't see its necessity.
 

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