Reputation: 259
According to w3schools I can set default value in MS Access this way:
ALTER TABLE Persons
ALTER COLUMN City SET DEFAULT 'SANDNES'
But this variant gives me
"Syntax error in ALTER TABLE instruction".
Also doesn't work:
"SANDNES"
(SANDNES)
I'm confused about that. My City Column hasn't any constraints or dependencies.
MS Access 2007. What i'm doing wrong ?
What important to mention: I should use SQL VIEW inside MS Access to set default value
Upvotes: 1
Views: 1873
Reputation: 110
Do you have to sql for it? Otherwise do it like this:
Set a default value for a table field
In the Navigation Pane, right-click the table that you want to change, and then click Design View.
Select the field that you want to change.
On the General tab, type a value in the Default Value property box.
The value you that you can enter depends on the data type that is set for the field. For example, you can type =Date() to insert the current date in a Date/Time field.
Save your changes.
Upvotes: 1