Ask Your Question
0

When trying to submit a new record to a table in Base, error code -1 is received. How to fix?

asked 2020-01-04 21:08:02 +0200

vexhex22 gravatar image

updated 2020-01-06 01:10:57 +0200

I am trying to add a new record to a table via a database form linked to the table. However, upon clicking either the navigation bar's "New Record" or "Save Record" buttons, I get this error message:

Error inserting the new record

java.lang.NumberFormatException

Details:

Error code: -1

java.lang.NumberFormatException

Screenshot of the error dialog boxes

OS: Windows 10

LibreOffice Version: 6.3

Database Type: HSQLDB Embedded File

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-01-04 21:29:20 +0200

Ratslinger gravatar image

Hello,

There is too little information to give a specific answer. The most likely reason is trying to input data of mixed type into a field specified as some type of numeric. See -> 10 Reasons of java.lang.NumberFormatException in Java - Solution.

What is not displayed is which field is the cause of the problem. This should not be difficult to determine. Test by using entry of only one field at a time until the error occurs. A guess here is that the probable cause is either the Date field or the Phone number field (formatted field?).

Please when posting include OS, specific LO version used and with Base the database used. In this particular example it would be helpful to know the field types and controls used. For that, posting a sample (scrubbed) would be best.

edit flag offensive delete link more

Comments

Noted the last part of your post. The information requested is now on the bottom of my original post. Thanks for your help!

vexhex22 gravatar imagevexhex22 ( 2020-01-06 01:11:52 +0200 )edit

But did you solve your problem?

Ratslinger gravatar imageRatslinger ( 2020-01-06 01:17:04 +0200 )edit

No, I tried testing with the two fields (date and phone number) that you suggested. Before posting the question, I tested with the text fields (email, city, etc.), to no avail, and just now I tested again and I think it might be the state field's list box causing the problem. I think that it might work with a regular text box, but I want some way to ensure that only real US state abbreviations can be inputted into the form. However, I haven't figured out how to do this successfully, and I haven't found anything (in terms of actual methods to do this) specific enough for a beginner like me to understand and put into action. Any more help here is appreciated, and thanks for reading this despite it leading into a separate (but that I think is related to this) question!

vexhex22 gravatar imagevexhex22 ( 2020-01-06 02:21:00 +0200 )edit

Again, the best thing here may be for you to post a sample. Just edit the question and use the "Paperclip'" icon in the toolbar (upper left of question) to append. Just no personal info. Can always make a copy of the Base file and delete personal data there and post that.

Have dealt with list boxes for this purpose in the past. Should certainly not need to change to a text box.

Ratslinger gravatar imageRatslinger ( 2020-01-06 02:32:33 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-01-04 21:08:02 +0200

Seen: 111 times

Last updated: Jan 06