IsEmpty in Expression Builder (1 Viewer)

rosdi

New member
Local time
Today, 15:35
Joined
Feb 20, 2018
Messages
6
Hi,

I would like to add this code to a textbox through EBuilder:

="(" & [Company Number] & (" / ") & Trim([Other Number]) & (" / ") & Trim([Other Number 1]) & ")"

The [Other Number] and [Other Number 1] is an optional fields for user to keyin.

When either one or both fields are empty, the " / " should not appear. How to do that?

Thanks.
 

Mark_

Longboard on the internet
Local time
Today, 00:35
Joined
Sep 12, 2017
Messages
2,111
From the look of it you wouldn't?

What is "Company Number", "Other Number", and "Other Number 1"? From their names I'm guessing they should be in a child "Number" table for the company.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 03:35
Joined
Feb 19, 2002
Messages
43,371
What do you expect to happen to the value after the user enters data at the prompt? It isn't going to be saved. The control is not bound.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:35
Joined
May 7, 2009
Messages
19,246
use:

="(" & [Company Number] & ( " / " + [Other Number] ) & (" / " + [Other Number 1]) & ")"
 

rosdi

New member
Local time
Today, 15:35
Joined
Feb 20, 2018
Messages
6
From the look of it you wouldn't?

What is "Company Number", "Other Number", and "Other Number 1"? From their names I'm guessing they should be in a child "Number" table for the company.

Those three are fields in the same table
 

rosdi

New member
Local time
Today, 15:35
Joined
Feb 20, 2018
Messages
6
for example:

[Company Number] = 123456-K
[Other Number] = KPL1234
[Other Number 1] = LKU4567

In the report, I add a textbox to combine those three fields through Express Builder.

Case 1:

[Company Number] - must has value/required
[Other Number] and [Other Number 1] - not necessary but user keyin the value. So the result will be: (123456-K / KPL1234 / LKU4567)

Case 2:

[Company Number] - must has value/required
[Other Number] - no value
[Other Number 1] - has value. So the result will be: (123456-K / LKU4567)

Case 3:

[Company Number] - must has value/required
[Other Number] - no value
[Other Number 1] - no value. So the result will be: (123456-K)
 

jdraw

Super Moderator
Staff member
Local time
Today, 03:35
Joined
Jan 23, 2006
Messages
15,386
A couple of comments for consideration.

Using field names with embedded spaces will lead to syntax errors. Better to use only alpha chars and underscore"_".
What do these 3 fields represent in your business? Suggest you give these fields mre meaningful names.
In plain English what is the user keying in and why?

You call them numbers but it seems these are all strings?
 

Mark_

Longboard on the internet
Local time
Today, 00:35
Joined
Sep 12, 2017
Messages
2,111
Have you tried Arnel's response? Post #4.. Should do exactly what you are asking for display. Note: This would work well for an unbound control. This will not work if you are trying to save this value.
 

Users who are viewing this thread

Top Bottom