Setting a specific field to Null on condition.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in my form that looks like this:
"Type: " & [Type]
However, I would like the field to be empty if [Type] is Null. How can I do
that? I have tried with the expression-builder on the field but can't figure
out how.
Thanks in advance for any help!
 
Try:
="Type: " + [Type]

Although & is the preferred operator for concatenation, you can also use +
and there is a subtle difference:
"A" & Null => "A"
"A" + Null => Null
 
Use Str() to convert the number to a string, i.e.:
="WW: " + Str([Width])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Anders Berlin said:
Works fine, but I tried to do the same with a numeric field, and that
didn't
work, obviously... example:
="WW: " + Width

(Width is the numerical field)

How to solve this problem then?
Thanks!

Allen Browne said:
Try:
="Type: " + [Type]

Although & is the preferred operator for concatenation, you can also use
+
and there is a subtle difference:
"A" & Null => "A"
"A" + Null => Null


Anders Berlin said:
I have a field in my form that looks like this:
"Type: " & [Type]
However, I would like the field to be empty if [Type] is Null. How can
I
do
that? I have tried with the expression-builder on the field but can't
figure
out how.
Thanks in advance for any help!
 
Back
Top