Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-02-2009
Member
 
Join Date: Jul 2006
Posts: 273
Date Format in Visual Basic

Hello, i know how to assign a date format text box. I know that to assign a monetary format on tape the following code Text1.Text = Format (Text1.Text ,"##,###. 00 ") but if it is a date format the how ?. Is it possible to change the date format of ms access from mm/dd/yyyy to dd/mm/yyyy ?
__________________
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signatureto help him gain world domination
Reply With Quote
  #2  
Old 09-02-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Date Format in Visual Basic

Hi
You are experiencing the wonders of MSAccess in US style. This is the default display and read format for Access and cannot directly be changed.
What you can do, tho, is change the data where it is displayed (on form or report).
To do so:
Select the control, then view properties, and change output format to Short Date - this will pick up your windows settings.
Note: In my experience Windows settings are generally only used by ADO command objects and not by access when searching for fields in queries. I am sure that if you have a non-english locale (ie. German) you can use US dates still or DEU Dates, so I think the rule is access assumes all dates are in US format, unless it cannot , then it uses the windows locale.
To test:
search for 11/12/2008 in a uk-english locale, and you'll see Nov 12 2008 records (not, dec 11 2008)

Hope this helps,
Reply With Quote
  #3  
Old 09-02-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Date Format in Visual Basic

Hi,
With VB6, the date format is done with the following example:
Private Sub Command1_Click()
Text1.Text = Format(Text1.Text, "dd/mm/yyyy")
End Sub

Private Sub Form_Load()
Text1.Text = Format(Date, "dd/mm/yyyy")
End Sub
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Date Format in Visual Basic"
Thread Thread Starter Forum Replies Last Post
What is the use of Dialog box in Visual Basic? Alibamu Software Development 5 02-01-2011 11:47 PM
what are Visual Basic IDE? Naresh Modi Software Development 2 06-03-2009 09:49 AM
Is GUI same like Visual Basic ? Caesar Software Development 2 02-03-2009 01:32 PM
Visual Basic 2005 or Visual Basic 6 Aasha Software Development 5 15-01-2009 06:56 PM
Visual Basic on LAN djbbenn Software Development 2 05-08-2008 02:15 PM


All times are GMT +5.5. The time now is 01:52 AM.