Undesirable automatic text replacement

I discovered that some words registered in the “Anotações” field of my “tblFilmes” were automatically changed, without me noticing it before, having been replaced by numbers. I was frustrated because there are many notes with numbers that I had not entered and I did not know how they had ended up there.

Now I discovered that the numbers had replaced words and that this replacement had a logic. In this database there is a “tblGéneros” with the fields “ID” and “Género” and what happened was that the words equal to the genres existing in the “Anotações” field were automatically replaced by the ID number


of the table.
Please see the image. Does anyone have any idea why this happened and how to fix it?
My natural intelligence is already not famous and with this forced “Artificial Intelligence” it gets even worse.

What’s the source of the form, special the field, which now contains numbers instead of text?

Well, let’s see, the source of the form is the table “tblFilmes”. In this table there is a text [varchar] field named ‘Género’ that receives the code of the film type.
The film type options are included in the table “tblGéneros” with only 2 fields (Code and description): ‘ID’, Integer [integer], and ‘Género’, Text [varchar].
Ya! You’re right! Here, I think I have a relationship problem because to the text field in “tblFilmes” ‘Género’ corresponds the numeric field in “tblGéneros” ‘ID’.
So, ‘Género’ in “tblFilmes” should be type Number and not Text.
Ok. But so far I haven’t had any problems with the database. Could this be the likely cause of the words being replaced by the code?
I have already done several tests on the database using the names of the ‘Géneros’ from the “tblGéneros” in the ‘Anotações’ field of the form and nothing happened - there were no replacements of the words by their respective numerical codes from the table. The situation must have been sporadic and I have already manually corrected all the names replaced by numbers.

However, although I don’t believe in miracles, in computer science anything is possible and I would like to understand what could have caused this problem. Thanks for the tip.

Another tip for the fire:
The ‘Género’ field on the form (see photo above) displays the description instead of the code in the form’s table, due to the SQL in the list box.


Could the SQL have also worked, but in reverse, in another field on the form?
Ok. This is impossible.Right?

Field ‘Anotações’ : How does this field get it’s data? Is this field part of a table? What is saved in this field in the table?

The ‘Anotações’ field is part of the main table, “tblFilmes”. It’s a Text VARCHAR, 300, field, that receives my comments/remarks/inputs about the movie in the main form, manually, shown in the photo above, and does not receive information from any other source.

The problem occurred when some words I entered in this field matched the description of the fields in the film types table ‘tblGenres’ and were incomprehensibly replaced by their respective codes.
In other words: I wrote “This film is a very interesting police series of crime, drama and mystery.” and some time later I noticed that the words police, drama and mystery had been replaced by the numbers 2, 3 and 20, because the descriptions in ‘tblGenres’ matched: 2 is the key number corresponding to the Police description, 3 to the Drama description and 20 to the Mystery description.
The situation seems complicated to explain but it is not difficult to understand. The hard part is accepting it! Right?

Have never seen such a behavior in a Base document.
Did you install any extension?
Do you use macro code special for this field?
Which version of LO do you use (Copy Help → About LibreOffice → Versioninformation)?
Did you try with a new user profile?

Ok. This was also the first time this happened to me. And I also admit that it must have been caused by some SQL test I did in the past that caused some words to be replaced by numbers and I didn’t realize it.
Anyway, I’ve already tried to write an SQL UPDATE query code in order to cause the same problem and I couldn’t: To replace the words in the “Anotações” field in “tblFilms” table (24 words), corresponding to the “Género” field of the “tblGéneros” table (24 type of films), with the respective code in the same table. Why? What for? I would never have tried to do this.
Anyway, RobertG, thank you for trying to understand the situation.