Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 15th, 2008, 10:31 AM
Authorized User
Join Date: Feb 2007
Location: Southampton, Hampshire, United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating tables on the fly

I have a database, where I create tables dynamically in code. These tables are temporary tables for which their size and fields are only known at runtime. I have no problem creating a table using the TableDef, Field and Index objects, however when I append the table to the database using CurrentDb.TableDefs.Append MyTable, the table does not appear in the list of tables in the left pane, even after having called CurrentDb.TableDefs.Refresh. The only way I can see it is to close and re-open the database.

When these tables are created, there is a lot of processing going on, so is it an Application level event that hasn't been able to fire? Will a strategically placed DoEvents do the job, or is it something else?

Many thanks for any help!

Reply With Quote
  #2 (permalink)  
Old January 15th, 2008, 10:49 AM
Authorized User
Join Date: Feb 2007
Location: Southampton, Hampshire, United Kingdom.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts

I *may* have figured this out. Calling the Application level method, RefreshDatabaseWindow, seemed to do the trick, although the table didn't appear until after execution had finished, rather than when the method was called, which is fine. I'm not putting my hopes on it always working though.

Can anyone confirm this was the right thing to do?

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a DTS package on the fly in C# dramz C# 0 July 18th, 2007 01:04 PM
creating textfield on the fly Acod Classic ASP Professional 1 April 25th, 2007 09:22 AM
creating controls on the fly mtrtxs Access 9 September 10th, 2004 04:51 AM
Creating htmls on the fly... merguvan Classic ASP Basics 5 January 31st, 2004 03:31 PM
Creating form controls on the fly roniestein Access 6 December 23rd, 2003 01:30 PM

All times are GMT -4. The time now is 02:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.