EagleTempest
Technical User
VB6 and Access.
I was looking for a work around when adding new records with blank (null) fields.
I thought I'd create a function to check each field such as:
I guess by sending it back as a String it's no longer a Null item but an empty string and therefore I don't get any errors about "Field cannot be a zero length string".
I'm guessing this is bad programming although a cute trick. Is there an easy way to convert any Null textbox value to "" when adding to a record to a database?
I was looking for a work around when adding new records with blank (null) fields.
I thought I'd create a function to check each field such as:
Code:
Public Function CheckNull(strCheck As String) As String
If strCheck = "" Then
CheckNull = "yes" 'dummy filler code for checking
End If
End Function
I guess by sending it back as a String it's no longer a Null item but an empty string and therefore I don't get any errors about "Field cannot be a zero length string".
I'm guessing this is bad programming although a cute trick. Is there an easy way to convert any Null textbox value to "" when adding to a record to a database?