Microsoft Access Default Value

C

Charlie

Hi,

I would like to set a 'default value' in a table that updates feild with the
'current year only'!

Thanks
 
J

Jeff Boyce

Charlie

A matter of definitions ... in Access, a "default" value is what Access
inserts into a new record. Default values don't "update" fields.

If you need to update a field for a number of rows, use an update query.

I'm not quite clear on what you are trying to accomplish -- can you explain
it a bit more?
 
D

Duane Hookom

Open the table in design view and set the field's default to
=Year(Date())
 
C

Charlie

What i would like to be able to do is set a default value to the current year
for example "2004"

Thanks
 
C

Charlie

Hi Duane Hookom,

When I enter this =Year(Date()) it displays this date 26/06/1905
If Possible i would like to be able to just show the current year

Thanks
 
D

Duane Hookom

That makes sense to me since the displayed date is probably the 2004th day
beyond Dec 30,1899. If you want to just store the year, set the data type to
Long Integer and format it as general number with no decimal places.
 
B

Bruce

Try setting the field's data type to Date/Time, its default value to =Date(),
and its format to yyyy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top