I've been told that the savvy programmer never allows a zero length string; well, I'm not savvy, or schooled for that matter; and the truth is there are lots of times that I don't need the user to enter data and zero length string is totally acceptable.
ex: on an UNBOUND form I have: Boolean field: blnAlternateMfr_YN; followed by: short text field: cboAlternateMfr_Name (entered in a combo box control)
txtAlternateMfr_Name could be null, or ZLS (it doesn't matter and is not required); the user could have entered a text of # length, but then the changed their mind and backspaced to a blank entry (ZLS) -it's OK
The problem is that when I assign the values in the form to the relevant tables, if the entry is a ZLS, a line of code such as:
rstTarget![txtAlternateMfr_Name] = Me.cboAlternateMfr_Name
causes ACCESS to throw an error at me (understandably)
(This is part of a constantly evolving project, and because MS in their wonder has flip-flopped on the default value for allow ZLS, depending on when the user's back-end table was created (by code), the default may be No, or it maybe YES ...further aggravating me ... I digress)
NTL,
There must be a standard approach for dealing with this condition (Going to each of the back-ends (each user has their own), and manually changing the default is not really an option, although I suspect that could do it by code, but that wouldn't be too savvy, would it?)
Any suggestion, direction, or even a stern, but productive lecture will be greatly appreciated with many thanks in advance.
Mark