Sup, I have a table DBColor, that have the IDColor and Color columns, both columns are set to unique. I created a form where the user can enter a new color in a combobox.
An example, if the color white is already on the table, when the user tries to write white in the combobox, base returns a msgbox containing the errors, errors in the plural because there are 2 that happen.
The first one is because the register was unable to be saved, and the second one is because the table doesnt accept duplicate values on the column Color, but libreoffice base translate this two errors, in only one msgbox, that closes when you click ok, but this doesnt apply when I try to write a macro to handle the errors better, by putting more cohesive information for the user on the msgbox.
I’m putting the macro inside the form control on the error ocurred event, but it turns out that here the two errors are divided, the macro run for the first error, and then again for the second error, so the user have to click ok two times for the same message, what is kinda annoying.
What I would like to have is something like the default error that base shows, but with a different text inside it, so I can keep things more clear for the user, or a way to put this two errors together, so the user receive only one msgbox, I need this since Im not the one who will be using this DB.
This is the macro im using, its pretty simple:
REM ***** BASIC *****
Sub ERRORMSG
MsgBox "The value added is already on the table, please try again with a new value.", , "Error"
end sub