troubleshooting Question

I cannot see newly created table in VB code though it exists. Trouble with TableDefs...

Avatar of WestBillWest
WestBillWest asked on
Microsoft Access
6 Comments2 Solutions373 ViewsLast Modified:
Newly created table can not be seen until I get out of Access then back in.

Table I have deleted manually is still seen from my Code.

   I have scripted an import of a "FileName.exe_MMDDYY.csv" table but would like to check if a table name exists that I create within the function.  If the table exists I would like to increament the latest version suffix by 1 and check for that table until I have a unique table name.  i.e.  If TableName_1 exists create TableName_2.
   I loop through the table names until I get an error on - Set tdf = db.TableDefs(tblName).  This means the table does not exist and I can go on.  Else, Increament the suffix by 1 and check again until the table is not found.  The problem is that Access does not see the table I last created and the records are appended to that table.  When debugging I can see the table in the Access Object List but the code does not recognize.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros