Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table-list refresh in Access Project (.adp)

Status
Not open for further replies.

jimmyg423

Programmer
Nov 23, 2001
4
US
Is there a way to programmatically refresh the table list in a Access 2000 Project? I'm creating a table inside a SQL Stored Proc and using the DoCmd.TransferSpreadsheet to transfer the table's contents to a excel file.

I noticed that if the table does not exist before the Project is initially opened, and the table is newly created, that it gives me an error 7874 when I try to export the table via the DoCmd.TransferSpreadsheet function.

The table does exist on the SQL side, but, when I cycled through the tables catalog in the Access Project it didn't exist. Finally, I selected the tables list and from the menu bar selected the refresh option (F5) and the table appeared.
 
I searched everywhere and found out there isn't an option to do this. Took me a little while but here is the workaround if anyone is interested.

'Application.Echo False - is optional (turns off screen refresh)
Application.Echo False

'Selects the Database Window
DoCmd.SelectObject acTable, , True

'Send Refresh command to Access
SendKeys "{F5}", True

'Application.Echo True - is optional (turns on screen refresh)
Application.Echo True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top