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

coversion text date

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Coversion text to date

Coversion text to date

ResolvedVersion 2007

Nadia has attended:
Access VBA course

Coversion text to date

I need to know how to convert text field into date , then transfer this date in european date not in american format.

RE: coversion text to date

Hi Nadia

Thank you for your question.

The trick here is to create 2 variables. A string variable and a date variable. Set the string variable equal to your text field value, and then set that equal to the date variable using the Cdate function which converts the text string into a date

The following code gives an example of this. (It is taken from Excel VBA as this is easier to demo, but you can simply replace the literal string with the relevant field from the recordset.)

Sub DateConv()
Dim strDate As String
Dim dteDate As Date

strDate = "14/2/1964" 'Replace with relevant field
dteDate = CDate(strDate)

Range("c1").Value = dteDate


End Sub


The date format should be consistent with your local settings

Hope this helps

Regards

Stephen

RE: coversion text to date

Hi,

I have still the same problem, i am unable to convert my text into date. May i send to you my access database and you can do it for me at least the first time then i will practice on it?

Please let me know.

Regards,

Nadia MARNI SANDID

RE: coversion text to date

Hi Nadia

Please feel free to send the database with instructions on what you want to do and I will have a look for you

My email is stephen@stl-training.co.uk

Regards

Stephen

RE: coversion text to date

Hi Nadia,

Did you manage to send your workbook to Stephen?

This question has now been left unattended for a while.

We like to keep down the large number of active forum posts we receive.

As we are waiting for your response for further information to help resolve your issue, we will be automatically marking this question as resolved in the next 5 days (unless you post a follow-up within that time).

We look forward to hearing from you.

Thank you.
Regards, Rich

Wed 20 May 2009: 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:

Space marks

It is good practice not i to have space marks for field names as this can lead to problems when using queries or VBA code. It is much better to use an underscore charcter to represent spaces in field names

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.09 secs.