dates changing access

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

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Dates Changing in Access

Dates Changing in Access

resolvedResolved · Low Priority · Version 2003

Nicola has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course

Dates Changing in Access

Is there any way I can stop the dates from changing to American Format when exported from Access?

RE: Dates Changing in Access

Hi Nicola

Thanks for your question

This can be done by using a combination of datepart() functions, string cocatenation, and cdate functions to format the date correctly.
I will write a some code to solve this and will post it here later today or tommorrow

Regards

Stephen

RE: Dates Changing in Access

Hi Nicola

Sorry for the delay in following up

I have written a function which converts the date into UK format. When you pass the calendar's value to a variable you should pass the value as the USdate argument in the function

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


Hope this helps, please follow up if you have any questions

Regards

Stephen

Wed 10 Mar 2010: Automatically marked as resolved.

 

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:

Add current time to a field

Press CTRL+SHIFT+ SEMICOLON

View all Access hints and tips


Server loaded in 0.07 secs.