Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

date format activex calendar

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Date format activex calendar

Date format activex calendar

ResolvedVersion 2003

David has attended:
Access VBA course

Date format activex calendar

using the activex calendar the dates 1-12 of the month go to the query as mm/dd/yyyy format but 13+ go as dd/mm/yyyy format. Is there a way to force it to be consistent? Thanks

RE: Date format activex calendar

Hi David

Thank you for your question

You can do this using a combination of datepart() functions, string cocatenation, and cdate() functions to reformat the date.
I will write a small procedure to solve this and will post it here later today or tommorrow

Regards

Stephen

RE: Date format activex calendar

Hi David

Sorry for the delay in getting back to you. Here is the required code as promised.

This is a function. You should write a procedure that runs when you click the forms command button, that passes the calender's value to the function as the US date argument

If you have any questions please do not hesitate to get back to me


Public Function DateConverter(USDate As String) As Date

Dim strMonth As String
Dim strDay As String
Dim strYear As String
Dim strDate As String

strDay = DatePart("d", USDate)
strMonth = DatePart("m", USDate)
strYear = DatePart("yyyy", USDate)

strDate = strDay & "/" & strMonth & "/" & strYear

DateConverter = CDate(strDate)


End Function






 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Access tip:

Change The Default Font in Access 2003

You can change the default font in Access 2003 so that whenever you create a new database your preferred font is automatically set.

To change the default font:

1.From the menu bar select Tools.
2.Click Options.
3.Go to the Datasheet tab:
4.In the Default font section select your preferred font from the list of fonts e.g. Arial.
5.Select your preferred size from the size menu e.g. 12.
6.Click Apply.

Click on the Tables/queries tab:
1.In the Query Design font section select your preferred font from the list of fonts e.g. Arial.
2.Select your preferred size from the size menu e.g. 12.
3.Click Apply.
4.Click OK.

The default font for Access has now been changed.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.15 secs.