VBA Access Create Table

In this article I will explain how you can create a table in an access database using VBA.

The code below will create a table with the name “MyTable” using Docmd.RunSQL:

Sub Example()
DoCmd.RunSQL ("Create Table MyTable")
End Sub 

Result:
Result

Note: Attempting to create a table that already exists will result in a runtime error. A good idea would be to check if the table exists before trying to create it. This has been covered in the article below:

You can download the file and code used in this article from the link below:

If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website www.software-solutions-online.com

Leave a Reply

Your email address will not be published. Required fields are marked *