Ask Your Question

Geert Janssens's profile - activity

2019-01-22 17:00:50 +0200 answered a question Equivalent of VBA "OldValue" attribute for form fields

As I'm working in python and I find there are far fewer python examples than LibreOffice Basic examples, I will add my p

2019-01-22 16:59:53 +0200 commented answer Equivalent of VBA "OldValue" attribute for form fields

Great! That does help a lot. Edit Initially this comment also contained a python based equivalent of @Ratslinger's Basi

2019-01-22 12:13:47 +0200 received badge  Enthusiast
2019-01-17 00:46:49 +0200 received badge  Popular Question (source)
2019-01-12 17:28:12 +0200 received badge  Notable Question (source)
2019-01-12 14:18:15 +0200 marked best answer How to add custom attributes to a LO Base form

I have a form and wrote some macros to perform actions based on certain form events.

Now what I want to achieve is store the value of a calculation performed in a form control's "Before Update" event to be reused in the form's "After Record Action" event.

This is not data I want to store in the underlying database. It's more like state information to carry around to make informed decisions in various phases in the form's life cycle. As soon as the form closes, this state information can be forgotten.

My thought was to add some custom property or attribute to the form control object or form object and set or query that property as needed. Is something like that possible ?

2019-01-12 14:18:11 +0200 commented answer How to add custom attributes to a LO Base form

Oh, great! I didn't realize global variables would persist across macro calls. This opens up a whole lot of opportunitie

2019-01-12 12:48:38 +0200 asked a question How to add custom attributes to a LO Base form

How to add custom attributes to a LO Base form I have a form and wrote some macros to perform actions based on certain f

2019-01-12 11:29:33 +0200 commented answer Equivalent of VBA "OldValue" attribute for form fields

Great! That does help a lot. As I'm working in python and I find there are far fewer python examples than LibreOffice B

2019-01-12 11:08:03 +0200 commented question Equivalent of VBA "OldValue" attribute for form fields

What I referring to was not an SQL feature. I have used MS Access in the past with several backends (the built-in mdb an

2019-01-12 11:03:10 +0200 received badge  Supporter (source)
2019-01-12 11:02:45 +0200 marked best answer Equivalent of VBA "OldValue" attribute for form fields

When using forms on VBA, each form field as an "OldValue" attribute which is set when the user changed the field, but the field is not yet committed to the database row. This allows scripts to do things based on this old value as well as on the new value entered by the user.

I'm looking for a similar attribute or a way to retrieve this value in some way in Libreoffice Base macros.

My use case is as follows: I have a table with textual ID's and there is a file on disk linked to each ID (the filename is that ID). However if the ID changes, the file should be renamed as well. And in order to rename a file, I need to know the old ID as well as the new ID.

But so far I haven't found an attribute or function on a text field in LO that gives me access to this old ID. Is there a way ?

2019-01-12 10:54:17 +0200 commented answer Equivalent of VBA "OldValue" attribute for form fields

Great! That does help a lot. As I'm working in python and I find there are far fewer python examples than LibreOffice B

2019-01-12 08:19:36 +0200 commented answer Import csv with multi-line fields into LO base

This is embarrassing in several ways :( First I managed to not be aware of this reply for over 6 years. Secondly, now

2019-01-12 08:19:31 +0200 received badge  Scholar (source)
2019-01-12 07:52:36 +0200 received badge  Popular Question (source)
2019-01-11 21:51:15 +0200 asked a question Equivalent of VBA "OldValue" attribute for form fields

Equivalent of VBA "OldValue" attribute for form fields When using forms on VBA, each form field as an "OldValue" attribu

2013-02-22 06:44:28 +0200 received badge  Famous Question (source)
2012-08-17 21:50:36 +0200 received badge  Notable Question (source)
2012-06-08 01:32:02 +0200 received badge  Popular Question (source)
2012-05-04 10:09:55 +0200 commented answer Import csv with multi-line fields into LO base

Thank you for your reply. These two threads deal with the opposite of what I'm trying to accomplish. They explain how to export from base to csv while preserving multi-line fields. I tried the tip of using a memo type field as import field, but still during the import any newlines are stripped.

2012-05-03 16:08:14 +0200 asked a question Import csv with multi-line fields into LO base

I'm trying to import a csv file in libreoffice base. The peculiar thing about this csv file is that is contains fields with multi-line content.

I first opened the csv file in calc, which worked fine. Calc effectively displays the multi-line fields as multi-line.

Next I copied all cells and pasted them into an existing libreoffice base database table. While Calc handles the multi-line fields correctly, Base seems to discard any multi-line information. In base the field only holds one line, concatenating all the lines that make up the multi-line field. The field type in the table is TEXT/VARCHAR and is long enough to hold all the information.

Opening the table via a form also suggests the multi-line information has been stripped in the copy-past operation. I have created a form in which the field is displayed in a mult-line enabled text field, but all is shown as a single (long) line.

Any ideas how I can import multi-line content in a Base table ?