Hello,
I have a database with a field built as a unique index. When a user tries to create a record with an existing value for this field in the database, he gets this message:
I would like to be able to intercept the error in order to display a more sympathetic and "clearer" message.
Is this possible?
I think i have to use a Listener, I don't know how to implement it.
Sincerely,
[Base] Customize an error message
- jeanmi2403
- Posts: 29
- Joined: Tue Jan 29, 2008 12:37 pm
- Location: Sucy en Brie (France)
[Base] Customize an error message
Jean-Michel
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
Re: [Base]Customize an error message.
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
- jeanmi2403
- Posts: 29
- Joined: Tue Jan 29, 2008 12:37 pm
- Location: Sucy en Brie (France)
Re: [Base]Customize an error message.
Hello,
Moreover, it was I who translated the Base Guide into French...
I'm ashamed
but it doesn't work for this error..
I am shortsighted !
Moreover, it was I who translated the Base Guide into French...
I'm ashamed
but it doesn't work for this error..
Jean-Michel
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
Re: [Base]Customize an error message.
Open the form in the attached file and enter a duplicate. You get the msgbox defined in my macro titled "Macro: SQL Error"
- Attachments
-
- index_violation.odb
- (12.38 KiB) Downloaded 53 times
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
- jeanmi2403
- Posts: 29
- Joined: Tue Jan 29, 2008 12:37 pm
- Location: Sucy en Brie (France)
Re: [Base] Customize an error message
Very myopic! I hadn't seen the title of the message box.
I had simply noticed that the message was the same.
Thank you very much.
I had simply noticed that the message was the same.
Edit: But it works only if the field is a primary key. Unique constraint on an other field do not work, the macro is not executed and the original message is displayed |
Jean-Michel
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
Re: [Base] Customize an error message
My personal work-around that has been proven as good enough: Give a talking name in upper case letters to the index, so the original error message includes a not so hidden human message like "PLEASE_ENTER_UNIQUE_NAME"
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
- jeanmi2403
- Posts: 29
- Joined: Tue Jan 29, 2008 12:37 pm
- Location: Sucy en Brie (France)
Re: [Base] Customize an error message
Ok, crafty !!
Thanks
Thanks
Jean-Michel
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX
LibO 7.4.7 and AOO 4.1.14 on Windows 10 x64, Windows 11 & Ubuntu 22.04
LibO 7.5 on OpenSuse & Linux MX