im trying to format a textbox to a date… so the user type in something like “01.12.2016” or “01.12.16”
so the best thing is to format the date when textbox lostfocus like “01.12.2016” and the db needs it like 2016-12-01 i think. How can i get this to work? On VB this is super easy cause the datepicker on xojo there isnt a standard feature like this
Read the Date the user fills (but you will have hard time if the user fills 30.02.2016 so more work to avoid that),
Create a Date Class instance and fill it with the user data,
And pass to the db the date as SQLDate (UserDate.SQLDate)
Also, if your user can live in the USA or other parts of the worl, you may have troubles with its passed date: 30.03.2016 is easy, but what about 12.11.2016 ?
You can set a window with some PopupMenus:
one PopupMenu for the Days (filled based on the Month value)
one PopupMenu for the Months (1 12)
one PopupMenu for the Years (2001 2020) or a ComboBox with some pre-defined years.
A PushButton that have code that create a Date object and fill it + pass it to thd db.