PC Review


Reply
Thread Tools Rate Thread

Could not find output table error

 
 
Van T. Dinh
Guest
Posts: n/a
 
      25th Sep 2003
Is "H:\Project Numbers\Project Number Master.mdb" the
Current database?

If it is, then you can simply use:

Set dbs = CurrentDb()

rather than the OpenDatabase statement.

If it is not, then your INSERT SQL statement won't work as
JET will look for the "tmptbl1" in the Current database
and you get the error posted. You need to use the In
Clause (check JET SQL Reference in Access Help) to specify
the location on the "tmptbl1".

After fixing the above and if it still doesn't work, try
the statement:

DBEngine.Idle dbRefreshCache

after the statement dbs.Close in your code.

HTH
Van T. Dinh
MVP (Access)



>-----Original Message-----
>I am attempting to run the following code in Access VBA
>module for a form and receive the error message:
>
>"could not find output table 'tmptbl1'"
>
>table1 is a linked table (to MS SQL server)
>creating table tmptbl1 in the same database as the form
>
>Code:
>'create a new temporary table in the local database
>holding the first step of
>'determining what active division has no active
>subdivisions
> Dim dbs As Database
> Set dbs = OpenDatabase("H:\Project Numbers\Project
>Number Master.mdb")
>
>' Create a table with two fields.
> dbs.Execute "CREATE TABLE tmptbl1" _
> & "(DivisionID INT, Active CHAR);"
> dbs.Close
>
>'now insert into the temporary table the following
>information
> stSQL = "INSERT INTO tmptbl1 " & _
> "(DivisionID, Active) " & _
> "SELECT dbo_table1.DivisionID, " & _
> "dbo_table1.Active" & _
> "FROM dbo_table1 " & _
> "WHERE (((dbo_table1.Division_Active) = -

1)) "
>& _
> "GROUP BY dbo_table1.DivisionID, " & _
> "dbo_table1.Active;"
>
>'run the sql statement
> DoCmd.RunSQL stSQL
>
>Any help would be greatly appreciated!
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error 'Could not find output table ... Acie Microsoft Access 1 1st Dec 2009 05:34 PM
table columns don't show when table opened or in query output disp dizzyp Microsoft Access 1 30th Apr 2008 12:10 AM
Runtime error 2501 Output to / output Query / excel ODR via AccessMonster.com Microsoft Access VBA Modules 8 3rd Mar 2008 04:54 PM
Running Macro - output pivot table to excel - error message 2046 =?Utf-8?B?Qm9i?= Microsoft Access VBA Modules 0 13th May 2007 03:56 AM
can I change text field size in output table of make table query? =?Utf-8?B?UE5fU2FtbQ==?= Microsoft Access Queries 2 22nd Dec 2004 05:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:57 AM.