Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default UserForm including TextBox with date (UK format)

Hello

I have database which includes also dates in UK format (dd.mm.yyyy). I
am able to display everything using UserForm with TextBoxes, but dates
are displayed in US format (mm/dd/yyyy).
I am able to change that when I leave the TextBox where is the date
using the following procedure

Private Sub TextBox13_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim dt As Date
dt = TextBox13.Text
TextBox13.Text = Format(dt, "dd.mm.yyyy")
End Sub

but the question is - is there some way to display date in UK format
immediately when UserForm with the TextBox including date is
displayed? (after UserForm.Show)? so there is no need to go into the
TextBox with date?

Thanks for the comments
Regards
Johny
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default UserForm including TextBox with date (UK format)

John,

Why don't you also format the textbox when you load it?

Texbox1.Text = Format(theDate,"d.mm.yyyy")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"John Elink" wrote in message
om...
Hello

I have database which includes also dates in UK format (dd.mm.yyyy). I
am able to display everything using UserForm with TextBoxes, but dates
are displayed in US format (mm/dd/yyyy).
I am able to change that when I leave the TextBox where is the date
using the following procedure

Private Sub TextBox13_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim dt As Date
dt = TextBox13.Text
TextBox13.Text = Format(dt, "dd.mm.yyyy")
End Sub

but the question is - is there some way to display date in UK format
immediately when UserForm with the TextBox including date is
displayed? (after UserForm.Show)? so there is no need to go into the
TextBox with date?

Thanks for the comments
Regards
Johny



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default UserForm including TextBox with date (UK format)

Bob

works fine, thanks a lot :)

Regards
Johny

"Bob Phillips" wrote in message ...
John,

Why don't you also format the textbox when you load it?

Texbox1.Text = Format(theDate,"d.mm.yyyy")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"John Elink" wrote in message
om...
Hello

I have database which includes also dates in UK format (dd.mm.yyyy). I
am able to display everything using UserForm with TextBoxes, but dates
are displayed in US format (mm/dd/yyyy).
I am able to change that when I leave the TextBox where is the date
using the following procedure

Private Sub TextBox13_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim dt As Date
dt = TextBox13.Text
TextBox13.Text = Format(dt, "dd.mm.yyyy")
End Sub

but the question is - is there some way to display date in UK format
immediately when UserForm with the TextBox including date is
displayed? (after UserForm.Show)? so there is no need to go into the
TextBox with date?

Thanks for the comments
Regards
Johny

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format for Userform TextBox John Calder New Users to Excel 4 July 29th 09 10:19 PM
Need A date Mask format for a Textbox on UserForm [email protected] Excel Discussion (Misc queries) 2 November 4th 07 02:27 AM
Qn: Date Format in TextBox in UserForm? Michael Vaughan Excel Programming 1 August 23rd 04 10:03 AM
Format of textbox on userform and correct result Mark Excel Programming 1 July 13th 04 02:49 PM
Userform Textbox Currency Format Problems Dunce in SC Excel Programming 2 October 27th 03 12:45 AM


All times are GMT +1. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"