Results 1 to 3 of 3

Thread: Date Format in Visual Basic

  1. #1
    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

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    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,

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    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

Similar Threads

  1. What is the use of Dialog box in Visual Basic?
    By Alibamu in forum Software Development
    Replies: 5
    Last Post: 02-01-2011, 11:47 PM
  2. what are Visual Basic IDE?
    By Naresh Modi in forum Software Development
    Replies: 2
    Last Post: 06-03-2009, 09:49 AM
  3. Is GUI same like Visual Basic ?
    By Caesar in forum Software Development
    Replies: 2
    Last Post: 02-03-2009, 01:32 PM
  4. Visual Basic 2005 or Visual Basic 6
    By Aasha in forum Software Development
    Replies: 5
    Last Post: 15-01-2009, 06:56 PM
  5. Visual Basic on LAN
    By djbbenn in forum Software Development
    Replies: 2
    Last Post: 05-08-2008, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,902,096.81339 seconds with 16 queries