IN a form I created I want my Date field to automatically show the current date as the default date when creating a new record. I saw SQL code how to get current date but could not find a location in the date fields property box. What am I missing??? I know it must be simple.
Thanks in advance.
Bob
[Solved] Current Date as default date
- tiredtraveler
- Posts: 6
- Joined: Wed Jan 05, 2011 11:59 pm
[Solved] Current Date as default date
Last edited by tiredtraveler on Wed Feb 02, 2011 7:29 pm, edited 2 times in total.
OpenOffice 3.3.0 using Windows XP
Vermont, USA
Vermont, USA
Re: Current Date as default date
No, it is not simple. Base can not hanlde any dynamic defaults such as current date, time nor user name. You need some macro which puts a valid value into the field when the form inserts a new record. But Base macros cause more pain than relief unless you are a fairly proficient programmer.
Normally, I do not show any fields with automatic content. If the user is allowed to override the default value, I add some label like "Date (Default: Today)".
Normally, I do not show any fields with automatic content. If the user is allowed to override the default value, I add some label like "Date (Default: Today)".
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- tiredtraveler
- Posts: 6
- Joined: Wed Jan 05, 2011 11:59 pm
Re: Current Date as default date
Thank you. Glad I asked before spending a long time on it. No, I am not a proficient programmer.
Any chance "current_date" would be/could be an option in some future release?
Any chance "current_date" would be/could be an option in some future release?
OpenOffice 3.3.0 using Windows XP
Vermont, USA
Vermont, USA
-
- Volunteer
- Posts: 828
- Joined: Fri Nov 30, 2007 10:58 am
- Location: Scotland
Re: (Resolved) Current Date as default date
Meanwhile you may find it helps to use a Date Field form control in your form that can be given a "Drop down" property. When selected a calendar for the current month is displayed together with a button for selecting today's date. Other dates can be just as easily selected.Any chance "current_date" would be/could be an option in some future release?
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB