Nulling a string

jar
12-05-2000, 12:39 AM
I have a string field in which a priority code is assigned. I notice that when the records are sorted on the priority code, records without a priority code seem to sort differently depending on whether there is a zero-length string or a Null in the code field.

The reason some records have blank priority code fields is that the user will be allowed to change or remove priority codes from the record as needed. For example, the record may have a high priority this week, but a low or no priority next week.

To solve this, I was trying to assign a Null instead of a zero-length string when the user wanted to remove the priority code. I was trying to do this to both the underlying database and the data-aware text control. For the latter, I would need to somehow Null the text property of the text control. I haven't been successful.

I guess I could take the opposite route and enter zero-length strings into all the records' priority code fields. But being able to assign a Null to only those that need changing would be simpler.

whelanp
12-05-2000, 03:03 AM
Why not just have a no-priority status value. NPRIORITY or something else in line with the rest of your codes.

No Nulls or 0 length strings.

jar
12-08-2000, 03:55 PM
Thank you! An excellent suggestion.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum