Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / December 2004

Tip: Looking for answers? Try searching our database.

Microsoft Access Default Value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charlie - 02 Dec 2004 10:15 GMT
Hi,

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

Thanks
Jeff Boyce - 02 Dec 2004 13:22 GMT
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?

Signature

Good luck

Jeff Boyce
<Access MVP>

> Hi,
>
> I would like to set a 'default value' in a table that updates feild with the
> 'current year only'!
>
> Thanks
Charlie - 02 Dec 2004 14:43 GMT
What i would like to be able to do is set a default value to the current year
for example "2004"

Thanks

> Charlie
>
[quoted text clipped - 13 lines]
> >
> > Thanks
Duane Hookom - 02 Dec 2004 13:23 GMT
Open the table in design view and set the field's default to
=Year(Date())

Signature

Duane Hookom
MS Access MVP
--

> Hi,
>
[quoted text clipped - 3 lines]
>
> Thanks
Charlie - 02 Dec 2004 14:45 GMT
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

> Open the table in design view and set the field's default to
> =Year(Date())
[quoted text clipped - 6 lines]
> >
> > Thanks
Duane Hookom - 02 Dec 2004 14:56 GMT
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.

Signature

Duane Hookom
MS Access MVP
--

> Hi Duane Hookom,
>
[quoted text clipped - 14 lines]
>> >
>> > Thanks
Bruce - 03 Dec 2004 19:55 GMT
Try setting the field's data type to Date/Time, its default value to =Date(),
and its format to yyyy.

> Hi Duane Hookom,
>
[quoted text clipped - 13 lines]
> > >
> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.