+ Reply to Thread
Results 1 to 5 of 5

date Format in Combobox - format changes when data is transferred to database??

  1. #1
    Registered User
    Join Date
    01-27-2012
    Location
    South Wales
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question date Format in Combobox - format changes when data is transferred to database??

    Hi all,

    I hope this is a simple fix but i've tried all ways and my database is having none of it (admittedlly i'm a complete ploker when it comes to code

    I've got a combobox on a user entry form and i've loaded it with Months in the following format "Jan-12" for example. trouble is, when this data is transferred to the database it's being displayed as "12-Jan" and i cant work out how to format it correctly?

    This is an extract of the code for the form i have

    Please Login or Register  to view this content.
    Hope someone can help. Cheers

    Glen

  2. #2
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: date Format in Combobox - format changes when data is transferred to database??

    And what code are you using to transfer the value to your database? What value do you want your database to hold? A text value such as "Jan-12" or an actual Excel date such as 01-Jan-2012?

  3. #3
    Registered User
    Join Date
    01-27-2012
    Location
    South Wales
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: date Format in Combobox - format changes when data is transferred to database??

    guess i didnt explain myself too clearly (apologies for this).
    I want my database to hold the text value of "Jan-12" " Feb-12" etc instead of an actual date. I plan to pop in an Advanced Filter based on the text value for each month (I'll cross that bridge once i've got the basics sorted)

    This is the code i used to copy data from my user form to the data base
    Please Login or Register  to view this content.
    I have an actual date entry already which can be entered manually (Like a specific invoice date) but my auto filter will then pull up all invoices within that month based upon the selection of the Period "Jan-12" etc

    really hope this makes sense - as said, I'm a sledge with code! 'pinched' what code i have from various websites i've trawled through....

  4. #4
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: date Format in Combobox - format changes when data is transferred to database??

    I think all you need to do is make sure the cell you transfer the data to is formatted as text:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-27-2012
    Location
    South Wales
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: date Format in Combobox - format changes when data is transferred to database??

    YOU ARE A STAR!!!!!!!!!

    Thanks so much for that - works a treat!

    now on with the advanced filter...... got a feeling i'm gonna be spending alot of time searching hrough this forum ha

+ 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