• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Userform Format TextBox Date

Rodrigues

Member
hi all
I'm experiencing some problems with format dates on "ListBox", when double click on a line to edit/populate data, Reg11 returns date in m/d/yyyy format on all lines (ID's)

I.e.
open the userform, click on cmdLookup-Lookup Staff, then double click on a line:



List Box 2nd row (ID4):
Date Completed 12/02/2018
Due In 13/04/2018 (both correct format dd/mm/yyyy)
after double click date populated:
"Reg11" - Date Completed 2/12/2018 (incorrect format)


List box 3rd row (ID5):
Date Completed 02/01/2018
Due In 01/02/2018 (correct format dd/mm/yyyy)
after double click date populated:
"Reg11" - Date Completed 1/2/2018 (incorrect format)


List box 5th row (ID6):
Date Completed 12/02/2018
Due In 14/03/2018 (correct format dd/mm/yyyy)
after double click date populated:
"Reg11" - Date Completed 2/12/2018 (incorrect format)


Checked all the dates format codes & columns and all are set to dd/yy/yyy.
Thanks in advance.
Regards
R
 

Attachments

  • Book2.xlsm
    76.6 KB · Views: 30
Hi,
Add this line of code:
Code:
 Reg11 = Format(Reg11, "dd/mm/yyyy")
in the
Private Sub lstLookup_DblClick(ByVal Cancel As MSForms.ReturnBoolean) event.
 
Thanks Beelleke, does work, was struggled to get this working as it was doing the same, then the penny dropped and deleted and recreate the data and does works fine.
Thank you so much for your help.
Regards
R
 
Back
Top