MS Access question VBA

How could I paste  same date format here. Date field is text field.Snap3627.png
Hiroyuki TamuraField EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

als315Commented:
If it is string, it has no format and can be copied/pasted as is. If you like to convert text from 2017/11/10 to 11/10/2017, you can use split function
In your sub:
Dim Arr() as string
Arr = split(TextA, "/")
TextA = Arr(1) & "/" & Arr(2) & "/" & Arr(0)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gustav BrockCIOCommented:
You should never use string handling for dates, no exceptions.

So, convert Me!Date to Date and:

Me!Date.Value = DateValue(Me!Field1.Value)

Open in new window

If that is not possible, use Format:

Me!Date.Value = Format(DateValue(Me!Field1.Value), "yyyy\/mm\/dd")

Open in new window

/gustav
PatHartmanCommented:
Formatting dates is for human consumption only. Internally dates are stored as double precision numbers and you should never format a date except for display or if you need to pass a date as a string to SQL.  If you leave your bound controls with no specific date format and you unbound controls where you want to enter/display dates formatted as "Short Date", then date formats will always conform to whatever your Windows system setting is.

If you are seeing different formats in your controls, look to see if one has an incorrect date format and remove it.  And Gus said it - never use strings for handling dates, no exceptions.
Hiroyuki TamuraField EngineerAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.