refreshing project in code

  • Thread starter Thread starter bill
  • Start date Start date
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
 
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.
 
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.
 
Back
Top