SalemGrafix
IS-IT--Management
I have been trying to save a record that I want to set the value in the field to NULL, and have been unsuccessful.
I have tried setting the field (ie. txtAmount.text = Null) and saving the record only to get an error message "Run-time error 94: Invalid Use of Null". I have also tried VBNULL, VBNULLCHAR, and VBNULLSTRING. The field allows for Null values, and is an integer field. If the field is already set as null, it has no problem, but if it contains a value, that's when the problem arises.
VBNULL actually doesn't create an error, it sets the field to "1" as the value instead. I have also tried to set the text field to chr$(0) with no luck either.
Is there some type of workaround for this problem? I have read on other sites (doing a Google search) that .NET has a new variable "DBNULL" that can be used, but I'm using VB6 (for many reasons at the moment), and am looking for some type of solution in VB6.
Thanks for any help that can be provided.
I have tried setting the field (ie. txtAmount.text = Null) and saving the record only to get an error message "Run-time error 94: Invalid Use of Null". I have also tried VBNULL, VBNULLCHAR, and VBNULLSTRING. The field allows for Null values, and is an integer field. If the field is already set as null, it has no problem, but if it contains a value, that's when the problem arises.
VBNULL actually doesn't create an error, it sets the field to "1" as the value instead. I have also tried to set the text field to chr$(0) with no luck either.
Is there some type of workaround for this problem? I have read on other sites (doing a Google search) that .NET has a new variable "DBNULL" that can be used, but I'm using VB6 (for many reasons at the moment), and am looking for some type of solution in VB6.
Thanks for any help that can be provided.