Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non Nullable Columns Being Updated to NULL Error

Status
Not open for further replies.

TMoney216

Programmer
Mar 1, 2002
11
0
0
US
Hi All and thanks in advance for any help you can give me.

I would like to know how once and for all to get rid of this problem. I have a column in my grid that is NOT NULL on the DB, in my KeyPress event...I haven't tracking for certain keys and disallowing or setting keyascii = 0 for others.

Well it works fine except for this....I hit backspace "nulling" the field....on my next keystroke..(an incorrect one) I get the Non Nullable Field error...then it hits my error handling code in the KeyPress event. How can I intercept the error?
 
Hi All Thanks for even looking but I found something I didn't realize about the datagrid. That error "Non nullable column cannot be updated to null" is easily handled with the datagrid1_Error(byval DataError as integer, byval Response as integer) event.

The DataError for "Non nullable..." = 7007....you can preview the error text by msgbox datagrid1.errortext in the event...from there set Response to 0 if you don't want to see that error appear anymore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top