UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Date & Time Format Only Show Year, Access 2016    
 
   
7MoonSage
post May 17 2019, 08:47 AM
Post#1



Posts: 16
Joined: 25-April 19



I'm trying to get a Model Year text box to only show year, and when I googled the issue I found "Year ( date_value )". When I place it in the default Value Box, my DB crashes. It also doesn't work in the format box.

So is there a way to make it only show the 4 Digit year?
Go to the top of the page
 
GroverParkGeorge
post May 17 2019, 09:31 AM
Post#2


UA Admin
Posts: 35,318
Joined: 20-June 02
From: Newcastle, WA


"Crashed" as in hard failure of the whole accdb?

No error messages?

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
BruceM
post May 17 2019, 10:08 AM
Post#3


UtterAccess VIP
Posts: 7,898
Joined: 24-May 10
From: Downeast Maine


Pardon me for asking, but did you use an actual date/time value instead of the generic date_value?

Why the Default Value? What is the actual expression you are using?
Go to the top of the page
 
theDBguy
post May 17 2019, 11:09 AM
Post#4


Access Wiki and Forums Moderator
Posts: 75,730
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Welcome to UtterAccess!
welcome2UA.gif

I agree, this doesn't makes sense. If you're using a date/time field in the table, why only show the year? Wouldn't you rather just use a number field? If it must be a date, how would users enter a valid date if you're only displaying the year? If you want to display the year out of a date field, you could use a separate textbox for it. Also, in the Format property, you would simply just use "yyyy" to display the year for a date value.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
7MoonSage
post May 17 2019, 02:22 PM
Post#5



Posts: 16
Joined: 25-April 19



Someone helped me figure it out now, so its no longer an issue.

George, yes, there was no error message. It went into (not responding) and only offered a close and restart option.

Bruce and Dbguy, yes I used an actual Date/Time and i was trying to get it to only show the Year for Model year of a product. I already have a separate Date and Time for manufactured date, and needed a separate for model year because the product(s) can be produced a year ahead, similar to cars.

The way I was shown to correct it was make a separate dropdown on a form and used VBA to only show the year.

Thank you all for responding though.
Go to the top of the page
 
theDBguy
post May 17 2019, 04:38 PM
Post#6


Access Wiki and Forums Moderator
Posts: 75,730
Joined: 19-June 07
From: SunnySandyEggo


Hi. Glad to hear you got it sorted out. Although, it sounds like a lot of work that maybe can be avoided. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd July 2019 - 01:01 AM