[Access 2007] How do i create table in VBA

dibangdit

New member
Local time
Today, 11:41
Joined
May 20, 2008
Messages
2
Hello.
I want to create a table from VBA code like this example:

Sub CREATE_TABLE()
Dim MySQL As String

MySQL = "CREATE TABLE exTable (ID integer, Name text (50))"
DoCmd.SetWarnings False
DoCmd.RunSQL MySQL
DoCmd.SetWarnings True
End Sub

My problem is i don't know which datatype i should use to create a memo field or how to create an autonumber field.

How many way to create a table automatically through VBA?

Thanks for you answers and please excuse my english.
 
Autonumber = counter
Memo = memo

e.g.:
"CREATE TABLE exTable (ID counter, Name memo)"
Creates a table with an autonumber field named "ID" and a memo field called "Name".
 
Thank you, ErikSnoek.
 

Users who are viewing this thread

Back
Top Bottom