PDA

View Full Version : Force user to use date format dd/mm/yyyy on User Form



Flupsie
06-12-2014, 10:37 PM
I have a user form containing various fields and would like code that forces the user to enter a date in the date field on the user form called called "TxtDate1" in the format dd/mm/yyyy. If not in this format Message box must appear advising user date format incorrect and they must enter date as dd/mm/yyyy

snb
06-13-2014, 03:11 AM
Offer the user a combobox (style dropdownlist) with all valid dates to choose from

Flupsie
06-13-2014, 09:10 AM
Thanks for the info. I think the best option would be to use datepicker add-on linked to the combobox. It would be appreciated of you could assist me in writing code to activate the datepicker or a built in calendar when selecting the date field in the combo box ("TxtDate1")

alansidman
06-13-2014, 01:03 PM
Look at this link

VBA Tips: A Pop-up Calendar for Excel (http://www.fontstuff.com/vba/vbatut07.htm)


or maybe this one.

Open the Calendar Automatically (http://www.fontstuff.com/mailbag/qexcel02.htm)

snb
06-13-2014, 01:54 PM
To fill a combobox:

VBA for smarties How to fill a Combobox / Listbox (http://www.snb-vba.eu/VBA_Fill_combobox_listbox_en.html)

Flupsie
06-13-2014, 08:37 PM
Hi Guys

Thanks for the pointers in the right direction