PC Review


Reply
Thread Tools Rate Thread

Dates and Combobox problems

 
 
=?Utf-8?B?R3JhaGFtIEY=?=
Guest
Posts: n/a
 
      15th Aug 2007
I have a user form with a combobox that has a row source set to cells
formatted as dd-mmm-yy. My problem is that the combobox displays this as a
serial number and then writes the date to the worksheet as mm-dd-yy. The
regional settings are set to English.I guess this is basic, but it is giving
me real problems. Any help would be much appreciated. Many thanks Graham
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      15th Aug 2007
When you put a date in a combox you need to convert it to a string. the can
be done with a format statement

string_date = format(mydate,"mm-dd-yy"). You want to write the actual
serial number date to the worksheet and make sure the cells are format as
date so you don't get a serial number displayed on the worksheet.

"Graham F" wrote:

> I have a user form with a combobox that has a row source set to cells
> formatted as dd-mmm-yy. My problem is that the combobox displays this as a
> serial number and then writes the date to the worksheet as mm-dd-yy. The
> regional settings are set to English.I guess this is basic, but it is giving
> me real problems. Any help would be much appreciated. Many thanks Graham

 
Reply With Quote
 
=?Utf-8?B?R3JhaGFtIEY=?=
Guest
Posts: n/a
 
      18th Aug 2007
Many thanks Joel, you solved the problem!

"Joel" wrote:

> When you put a date in a combox you need to convert it to a string. the can
> be done with a format statement
>
> string_date = format(mydate,"mm-dd-yy"). You want to write the actual
> serial number date to the worksheet and make sure the cells are format as
> date so you don't get a serial number displayed on the worksheet.
>
> "Graham F" wrote:
>
> > I have a user form with a combobox that has a row source set to cells
> > formatted as dd-mmm-yy. My problem is that the combobox displays this as a
> > serial number and then writes the date to the worksheet as mm-dd-yy. The
> > regional settings are set to English.I guess this is basic, but it is giving
> > me real problems. Any help would be much appreciated. Many thanks Graham

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates are not displayed in ComboBox ryguy7272 Microsoft Access VBA Modules 2 9th Feb 2010 02:26 PM
Simulating Windows Explorer Style ComboBox problems - with .net ComboBox Deepak Malkan [Bentley] Microsoft Dot NET Framework Forms 5 15th May 2005 11:30 AM
combobox with dates ReidarT Microsoft Access Form Coding 1 3rd Dec 2003 06:44 AM
Re: ComboBox with Dates Tom Ogilvy Microsoft Excel Programming 0 2nd Oct 2003 04:15 PM
Format dates in combobox Pete Microsoft Dot NET Framework Forms 0 2nd Sep 2003 08:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:51 AM.