I have a form that is used for data entry and for editting previous data. The form is unbound and all interaction with the underlying tables is done through a class module which keeps track of one line in a table at a time. The point of this is to allow entries and edits that can be moved across multiple forms and changed and converted without changing the original line in the table (Makes for easy undo after many changes) The Class Module can pull in the data from the fields on a form to add/update the table, and it can also populate the fields on a form based upon a given key field.
The problem I am having is when a field is empty/Null or a field in the database is empty/Null, I get errors because I am attempting to put a Null value into a variable in the class or field on the form when it won't allow it. Not all fields in the database are required or expected to always hold values. The only solution I have found is to check for null every time I try to get the values out of the class, or enter the values into the class.
I am wondering if there is a way to do this without all of the hassle of having to enter in "if not isnull(field) then" about 20-40 times depending on the number of fields in the table.
Any help would be appreciated.
Tom
The problem I am having is when a field is empty/Null or a field in the database is empty/Null, I get errors because I am attempting to put a Null value into a variable in the class or field on the form when it won't allow it. Not all fields in the database are required or expected to always hold values. The only solution I have found is to check for null every time I try to get the values out of the class, or enter the values into the class.
I am wondering if there is a way to do this without all of the hassle of having to enter in "if not isnull(field) then" about 20-40 times depending on the number of fields in the table.
Any help would be appreciated.
Tom