0
votes

I have a combobox that I use for filtering entries in the column below. The code reads the entries of the column and adds what it finds into the combobox (SELECT DISTINCT). This works fine if the columns don't have entries that are NULL. If they do, a blank field will show in the combobox (which is good, I want to be able to filter for empty entries). However, if I click on this field in the combobox, all entries are shown, not just the NULL ones. Does anyone know why this could be? Does Access convert NULL to an empty string? If so, can I circumvent this somehow?

1

1 Answers

0
votes

You are looking for the NZ function

Syntax

Nz ( variant [, valueifnull ] ) The Nz function syntax has these arguments:

variant

Required. A variable of data type Variant.

valueifnull

Optional (unless used in a query). A Variant that supplies a value to be returned if the variant argument is Null. This argument enables you to return a value other than zero or a zero-length string.

Note: If you use the Nz function in an expression in a query without using the valueifnull argument, the results will be a zero-length string in the fields that contain null values.

MS DOC: https://support.office.com/en-ie/article/nz-function-8ef85549-cc9c-438b-860a-7fd9f4c69b6c