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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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,
 
Hi,

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

Thanks.
Eaton
 
Back
Top