NeoDBPro error when adding record - "field 'fieldname' must have a value" - Forum

Forum Navigation
You need to log in to create posts and topics.

NeoDBPro error when adding record - "field 'fieldname' must have a value"

I can't figure out why I'm getting that error. I have an mdb file created with Access 2007. Among others, there are 4 text fields named option1-option4.

They're each set up with Required set to No.

Zero Length Strings I set both ways, yes and no, and got the error with both settings.

When any of those fields are empty, the record cannot be saved. If all 4 have content, the record saves correctly.

For the time being, I check each of those fields, and if empty, I put a space in it. That allows me to save the record with dbpSaveEdits.

I'd just like to know why I can't save empty fields if they're set to not required. Anyone have an idea?

@vwatson

I have an mdb file created with Access 2007.
They're each set up with Required set to No.
Zero Length Strings I set both ways, yes and no, and got the error with both settings.

a) Deploy the dbpGetFieldDefs command against this Table ... and post the results here.

b) Try and create the Table (or a copy of it) using the dbpCreateTable command; see if that allows empty text fields.

Oh, yeah, they're all 4 showing as Required using dbpGetFieldDefs.

There's no way to change the field definition in NeoWin, other than recreating the table?

This is just something for my own use, so it's working okay as it is.

I'll know next time to create the table in NeoWin.

@vwatson

There's no way to change the field definition in NeoWin, other than recreating the table?

I do not own MS Access 2007 ... but from this page on the Microsoft's Office support site ... https://support.office.com/en-us/article/require-a-value-in-a-field-d6bf6ff6-d653-48ef-b484-54a33c36f6c6 ... it looks like you can change the  Required property from within MS Access (the document describes the process for changing it to Yes, but should be the same for changing it to No ... good luck.

P.S. There seems to be a companion property called Allow Zero Length ... that should also be changed to Yes

Yeah, I already did that. Each field has Required set to No in Access and I set the zero length both ways and it didn't work either way.

@vwatson

Each field has Required set to No in Access and I set the zero length both ways and it didn't work either way.

With those settings, can you save records with no values in one/more of these fields from within MS Access 2007 ?

I copied the database, set Zero Length Strings to Yes, and I was allowed to add records with empty fields in Access, but when I tried using the exact same database in the NeoWin program, I got the error again.

Apparently there's something about that setting that NeoWin doesn't recognize.

@vwatson

I guess the moral of the story (experience) is "always create your databases using NeoDBPro commands"

If you already have a lot of records in your MS Access created Table, use NeoDBPro to ...

- create an identical Table (same field names, types and order)
- open both Tables
- copy all records in the original Table to the new Table (hint: take a look at dbpExportToCSV and dbpImportFromCSV to do it in one shot)

Vadim has reacted to this post.
Vadim

Yes. I'll certainly do that from here on. :)