Access doesn't see SQL table just created in same VBA script!

G

Guest

Hi,

Access 2003 adp:
In my VBA code, I create a new table in SQL Server and then want to access
that same table later in the same sub procedure. After the table has been
successfully created, I then get an error in Access saying it can't find the
object --when it is definitely there in SQL Server. If I close and re-open my
..adp, and run the same script, it finds the table.
Isn't there some kind method or function that can be called that would
refresh my .adp so that it sees the new table?
Using application.RefreshDatabaseWindow does not help.

Thanks,
Eaton
 
G

George Nicholson

How are you trying to reference the table? If it's through a Collection like
TableDefs, you would something like:
TableDefs.Refresh

I know that's necessary to get a correct Tabledefs.Count after a Delete, so
I assume it would be necessary after an Add as well.

HTH,
 
G

Guest

Hi,

I'm using DoCmd.OpenTable --I need to show the contents of thetable just
created in the same script.

Thanks.
Eaton
 

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