By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

creatin a table using access query

P: 4
I am trying to create a table in Access but i have a syntax error:

I just want to crate a table with default values for excample

create table test (column1 Text(20) DEFAULT 'This is a test')

I know it works in SQL.
Thanks in advance for the help.
Nov 18 '06 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,669
I am trying to create a table in Access but i have a syntax error:

I just want to crate a table with default values for excample

create table test (column1 Text(20) DEFAULT 'This is a test')

I know it works in SQL.
Thanks in advance for the help.
'I don't think that you can accomplish this directly in Access, but his will work

Dim MyDB As Database
Set MyDB = CurrentDb()

MyDB.Execute "CREATE TABLE TestTable (FirstName TEXT(50), LastName TEXT(125))"

MyDB.Close

CurrentDb.TableDefs("TestTable").Fields("LastName" ).DefaultValue = "Smith"
Nov 18 '06 #2

P: 4
Thank you it worked.
Nov 18 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.