VBA code to create a new Access database and table


 Sub CreateDatabase()

    ' Creates a new Access database and table

    Dim accApp As Access.Application

    Set accApp = New Access.Application

    accApp.NewCurrentDatabase "C:\temp\myDatabase.accdb"

    accApp.CurrentDb.Execute "CREATE TABLE myTable (ID INT, Name TEXT(50))"

    accApp.Quit

End Sub

VBA code to create a new Access database and table

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.