Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Display on form

Status
Not open for further replies.

kpryan

Technical User
Aug 24, 2005
282
US
Hi,

On a form a I use a few date fields. Instead of 15/11/07 showing is it possible to just show the day ie "15" in ms access. I could change it in windows, but then it would be difficult within other apps.

Many thanks,

Ken
 




Hi,

Check out the Format function.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Hi Skip,
What part of the format should I be looking at?
Ive checked the date formats but could not achieve what I wanted.

many thanks,

Ken
 




What did you try?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Hi Skip,
tried an input mask 00->L<LL-00 with various combinations. Should the date field be set to a text field and not a date field?

Ken
 




Did you read any HELP on the Format function?

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Hi Skip,
Yes I have read several help files, looked at many web pages etc, and read the help file,
but have not been able to find out how to do what I want.

Many thanks,

Ken
 
try

this will print the day
debug.print day(#1/2/03#)

this will print the month
debug.print month(#1/2/03#)

this will print the year
debug.print year(#1/2/03#)


(On a side note, sometimes the day and month get mixed up, thats the yanks formatting...)
 
Thanks Irishjoe,

For that info,
Just another question. Where do I put that line of code. Just not sure how to format that date field to get that result.

Many thanks,

Ken
 
Ken,

Skip and irishjoe have been trying to teach you to fish...not just feeding you for the day.

Skip's suggestion of the Format function is probably exactly what you want. If you open up any code window, type in Format, put your cursor somewhere in the word and hit F1 (or open up the help window and search for Format), you will find a description of this built in function. Among its many uses is the ability to change the display of text from one format to another (hence the name) without changing the actual values stored.

Where this gets placed in your application depends on a couple factors. First and foremost I would look to use this in the query that feeds the form (you are using a query and not directly from the table, right???). Find the field that houses the date you want to modify and put the Format function directly in query.

If this doesn't get you the expected results, let us know what you tried and what results you did get. Including the SQL for your query is always a plus for us to be able to help you help yourself. [smile]

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top