Default field in a table

%3CLINGO-SUB%20id%3D%22lingo-sub-1415644%22%20slang%3D%22en-US%22%3EDefault%20field%20in%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1415644%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20my%20database%20I%20a%20table%20with%20a%20field%20have%20a%20field%20called%20%22Year%22%20and%20at%20the%20moment%20this%20is%20set%20to%20a%20default%20for%20the%20current%20year%20i.e.%202019%20and%20I%20have%20to%20change%20it%20each%20year.%26nbsp%3B%20Can%20this%20field%20be%20updated%20automatically%20so%20that%20next%20year%20this%20field%20will%20be%20amended%20to%202021%20and%20so%20on%20through%20the%20years%20to%20come.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1415644%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1415977%22%20slang%3D%22en-US%22%3ERe%3A%20Default%20field%20in%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1415977%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F678730%22%20target%3D%22_blank%22%3E%40J0hn60rt0nmentions%3C%2FA%3E%26nbsp%3BInstead%20of%20hard-coding%20a%20value%2C%20use%20the%20relevant%20Date%20function%2C%20which%20is%20Year().%20Since%20you%20want%20to%20use%20the%20following%20year%2C%20not%20the%20current%20year%2C%20you'd%20use%20Year(Date())%2B1%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1417257%22%20slang%3D%22en-US%22%3ERe%3A%20Default%20field%20in%20a%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1417257%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46682%22%20target%3D%22_blank%22%3E%40George%20Hepworth%3C%2FA%3E%26nbsp%3B%20Hi%20George%2C%26nbsp%3B%20many%20thanks%20for%20the%20message.%26nbsp%3B%20I%20have%20tried%20it%20it%20I%20get%20a%20error%20message%20say%20%22Expression%20entered%20has%20a%20function%20containing%20the%20wrong%20number%20of%20arguments%22%20I%20have%20tried%20it%20in%20most%20of%20the%20relevant%20formats%26nbsp%3B%20Number%2C%20Date%2FTime%2Fand%20Short%20text.%20Any%20ideas%20please.%20What%20I%20thought%20would%20happen%20would%20be%2C%20as%20the%20database%20went%20over%20in%20to%20the%20next%20year%20the%20year%20will%20be%20auto%20updated%20which%20is%20what%20happens%20in%20the%20Date()%20function.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

In my database I a table with a field have a field called "Year" and at the moment this is set to a default for the current year i.e. 2019 and I have to change it each year.  Can this field be updated automatically so that next year this field will be amended to 2021 and so on through the years to come. 

5 Replies
Highlighted

@J0hn60rt0nmentions Instead of hard-coding a value, use the relevant Date function, which is Year(). Since you want to use the following year, not the current year, you'd use Year(Date())+1

Highlighted

@George Hepworth  Hi George,  many thanks for the message.  I have tried it it I get a error message say "Expression entered has a function containing the wrong number of arguments" I have tried it in most of the relevant formats  Number, Date/Time/and Short text. Any ideas please. What I thought would happen would be, as the database went over in to the next year the year will be auto updated which is what happens in the Date() function.

Highlighted

@J0hn60rt0nmentions Maybe I misunderstood the requirement. Here's what I thought you wanted:

 

DefaultYear.png

Highlighted

Hi George,  Many thanks for the help and it works,  That's great ....... Super ...... 

 

John

Highlighted

@J0hn60rt0nmentions Congratulations on solving the problem. Continued success with your project.