+ Reply to Thread
Results 1 to 2 of 2

Can't establish date format

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    115

    Can't establish date format

    Hi guys,

    I really need some help. I have an issue with all my user forms that I’ve never been able to resolve. It regards the dates and their format.

    In the Wbook in attach, the userform has the following purpose:
    I first insert some data and save it to the sheet “Base Dados” using the cmdguardar.
    I can’t insert all data because I’m depending on other people, so it is vital that I return several times to the userform to complete one record using listbox1 and cmdgravaralterações.

    Here lies my problem, of all the textboxes that contains dates, only the TextBox2 is filled the first time I insert a new record. All the other (textbox1, textbox4 and textbox6) are filled later on, at different times.
    While doing this, the textboxes assume different formats (dd-mm-yyyy and mm-dd-yyyy).

    Imagine: first I have 06-10-2010, and if I click the cmdgravaralterações button I then have 10-06-2010

    I can’t format the textboxes so that the date inserted in the userform remains always the same regardless how many times I have to change a record.

    Like I said, I have this problem with all of my user forms, so I urge for someone to help me.
    Thanks in advance.
    Attached Files Attached Files
    Last edited by ncaravela; 10-19-2010 at 08:20 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Can't establish date format

    When writing to the form from the sheet, use Format:
    Please Login or Register  to view this content.
    for example. When going the other way, use CDate:
    Please Login or Register  to view this content.
    and never bind the textboxes to the worksheet directly using controlsource.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1