PDA

View Full Version : Getting date format in comboboxes?



apen
06-06-2008, 08:56 PM
Hi all,:(

I have re-attached a file in which I still could not solve my problem -
the date display in the Combobox2 and Combobox3 not in format " dd-mm-yy" but instead of a value in the userform2.

If I change the Combobox to Listbox, then the format of date can display " dd-mm-yy" that I wanted. However, the datevalue could not be stored in the worksheets( "Attendance") if I pressed the cmdbutton (" confirm") in the userform2.

Could any expert point out my VBA where is wrong or missing, or how to re-write it.

Simon Lloyd
06-07-2008, 01:33 AM
I've not looked at your project but you get the date format like this:

Private Sub Combobox2_Click()
Me.ComboBox2.Value = Format(Date, "dd mmm yyyy")
End Sub

mdmackillop
06-07-2008, 01:44 AM
Strangely enough, the answer is the same as before (http://vbaexpress.com/forum/showthread.php?t=19881)
ComboBox2 = Format(ComboBox2, "dd-mmm-yy")

apen
06-07-2008, 02:13 AM
Dear Simmon and Mdmackillop,

Both your methods I have been tried, but a dialogue Box say " Compile Error" Can't find project or library"

How do I do ?

apen

Simon Lloyd
06-07-2008, 02:18 AM
Yep just checked your workbook, it's corrupt i think because i couldn't load any library references to it!

mdmackillop
06-07-2008, 02:18 AM
I gave you that solution as well here (http://vbaexpress.com/forum/showpost.php?p=145663&postcount=9).

Simon Lloyd
06-07-2008, 02:24 AM
Malcolm in the light that you and many others have answered this question both fully and expertly i am closing this thread.

Apen, if you duplicate post again intentionally ignoring help you have had previously you will incur a ban!

Please have the courtesy to acknowledge and thank those who have given up their valuable free time to give you free help!