+ Reply to Thread
Results 1 to 5 of 5

Capital text and date formatting from a text box on a form

  1. #1
    Registered User
    Join Date
    11-25-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2003
    Posts
    55

    Capital text and date formatting from a text box on a form

    HI, I have just started this project and have hit a small snag.... (or maybe snags)

    After entering the data in a form i would like to click the upload button the data from the text boxes move to sheet one.

    The StaffInitials boxes data to convert to upper case and the DateBox3 boxes data to be in dd/mm/yyyy format.

    Also if the person entering the date does so in the wrong format a error message appears like If Not IsNumeric.


    Please Login or Register  to view this content.
    Last edited by Wales MB; 11-26-2012 at 04:12 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Use IsDate to check for a date, use UCase to convert to upper case and CDate to convert to date.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-25-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Capital text and date formatting from a text box on a form

    The following error when testing
    "Compile Error can not find Project or library"
    Please Login or Register  to view this content.

    And when testing this I had a MsgBox when entering a number instead of the date, but when entering 25.11.12 instead of 25/11/12 no MsgBox and the data went over to the spread sheet in the wrong format?

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    I think you need to goto Tools>References...

    Check if anything is marked as MISSING.

    If it is note it's name and uncheck it.

    Then close Excel, reopen the file and try the code again.

    As for the date thing, IsDate checks for a valid date not a valid date format, and that is a valid date.

    Also, you say the date is in the wrong format on the sheet, how is the cell it's going in formatted?

  5. #5
    Registered User
    Join Date
    11-25-2012
    Location
    Swansea, Wales
    MS-Off Ver
    Excel 2003
    Posts
    55

    Re: Capital text and date formatting from a text box on a form

    Thanks for your help....

    The first error is fixed so easy when you know how.

    The column in sheet one is formatted to date dd/mm/yyyy but when typing in 11.11.12 on the form it pastes 11:11:12 AM in the sheet.

    Is there a code to use that would also check a 'valid date format' or convert it to a 'valid date format'

+ 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