the problem with your example is the extra spaces and the string inside the string
Nz(txtContract, " '' ")
should simply be
Nz(txtContract, "")
> constructing an SQL string in code
so maybe
Nz(txtContract, """")
or
Nz(txtContract, '')
inside a string delimited with double quotes, if you want...