Hi,
I need to get todays date + 14 days string formatted in standard dd.mm.yyyy format into Libre Office calc cell. I already tried the code below, but I lack the knowledge to cope with 'Object variab.
I spent hours searching in google how to set today date in a form with a macro and couldn't find a solution (the only solution given was to add a SQL command to default new record but it's not working when the date field is not attached to a table row)
So I thought I would share mine here, hope this is a good place.
- Create a macro like :
- Code: Select allExpand viewCollapse view
Sub SetDate (oEvent As Object)
oForm = oEvent.Source
oForm.getByName('inputDate').Text = Date()
End Sub
Call this macro on 'loading' event of the form containing the input date.
Hello. I created a diary in Libreoffice Base. It has four fields, those being ID, Date, Title, Entry. The ID field is a primary key field that is automatically created, and its field type is 'Integer [INTEGER]'. The date field is manually entered by me (which I hope to change to being created automatically) and its field type is 'Date/Time [TIMESTAMP]'. The other two are text fields.
Info:
I use Debian 9 (stable), and I use Libreoffice Version: 5.2.7.2
Build ID: 1:5.2.7-1+deb9u4. I have both OpenJDK 1.7 and 1.8 installed (I needed to install and enable 1.7 to be able to update my older LineageOS phone, though I've set LO to use 1.8 --> perhaps I need to change this to 1.7).
Efforts so far:
I tried searching for an answer to this and found the following: https://ask.libreoffice.org/en/quest...ction-in-base/
The suggestion there was to 'place a Text box where you want the date. Then in the fields' Data tab set as follows' ... select the option of TODAY() for it. I was unable to find that option after setting up a text box. The only options were to link to existing fields, so I linked to the date field and basically had an echo of this. Thus, not a solution.
I also tried the option of Insert/Field/Date, but that didn't work.
All ideas appreciated.
Info:
I use Debian 9 (stable), and I use Libreoffice Version: 5.2.7.2
Build ID: 1:5.2.7-1+deb9u4. I have both OpenJDK 1.7 and 1.8 installed (I needed to install and enable 1.7 to be able to update my older LineageOS phone, though I've set LO to use 1.8 --> perhaps I need to change this to 1.7).
Efforts so far:
I tried searching for an answer to this and found the following: https://ask.libreoffice.org/en/quest...ction-in-base/
The suggestion there was to 'place a Text box where you want the date. Then in the fields' Data tab set as follows' ... select the option of TODAY() for it. I was unable to find that option after setting up a text box. The only options were to link to existing fields, so I linked to the date field and basically had an echo of this. Thus, not a solution.
I also tried the option of Insert/Field/Date, but that didn't work.
All ideas appreciated.