98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access VBA Training and help » Coversion text to date
Coversion text to date
Resolved · High Priority · Version 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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Create An Inaccessible Field On A FormThere is sometimes a need to make a field in a form look like a normal field but be completely inaccessible to the user. To do this: |