coversion text date
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Coversion text to date

resolvedResolved · High Priority · Version 2007

replyReply Fri 13 Mar 2009, 11:56Delegate Nadia said...

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.

For upcoming training course dates see: Pricing & availability

replyReply Wed 18 Mar 2009, 10:55Trainer Stephen said...

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

replyReply Thu 19 Mar 2009, 14:07Delegate Nadia said...

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

replyReply Fri 20 Mar 2009, 14:19Trainer Stephen said...

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

Regards

Stephen

replyReply Thu 14 May 2009, 10:12Trainer Rich said...

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.

 

Please browse our web site to find out more about
training for microsoft access and other Microsoft training courses.

Access tip:

Display current date & time in column of any width

The worksheet function =NOW() returns the current date & time. When entered into a column which is not wide enough to display the value NOW returns, the cell displays ###

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard