managnig nulls in combobox sort

  • Thread starter Thread starter johnlute
  • Start date Start date
J

johnlute

I have a combobox that displays 3 columns:
numID (PK) | txtCode | txtDescription

Records may or may not have a txtCode. I'd like to sort txtCode by
Ascending order however this places nulls first.

Is there a way to make the nulls list AFTER? I know this defies the
logic of Ascending order but it would be helpful in this particular
scenario.

Thanks!
 
Wow, Bruce! Thanks! That did the trick!

You could use the Nz function to substitute a value for null.  For instance,
if txtCode is letters:

txtCodeSort: Nz([txtCode],"zzz")

If txtCode needs to be seen in the drop-down list you can keep the existing
row source, but add a sort:

SELECT numID, txtCode, txtDescription
FROM Table1
ORDER BY Nz([txtCode],"zzz")
I have a combobox that displays 3 columns:
numID (PK) | txtCode | txtDescription
Records may or may not have a txtCode. I'd like to sort txtCode by
Ascending order however this places nulls first.
Is there a way to make the nulls list AFTER? I know this defies the
logic of Ascending order but it would be helpful in this particular
scenario.
 
Back
Top