Form control to combine multiple field values into a single text box (1 Viewer)

brharrii

Registered User.
Local time
Today, 04:18
Joined
May 15, 2012
Messages
272
I'm trying to set the control source for a control on my report that describes the number of portions that goes into a box. Sometimes there is a specific number of portions per box and sometimes it's a range. When the number of units is specific, then it is entered into the MasterCaseMinUnits Field. If there is a range of units possible than the min is entered into MasterCaseMinUnits and the max is entered into the MasterCaseMaxUnits.

I want my report to look at the mastercasemaxunits, if it is blank it will only display what is in the MasterCaseMinUnits field. If there is a value in the masterCasemaxUnits field, then it will display the masterCaseMinUnits & " - " & MasterCaseMaxUnits. this is the code I'm Using:

Code:
=IIf(Nz([MasterCasemaxUnits],[MasterCaseMinUnits])=[MasterCaseMinUnits],[MasterCaseMinUnits],[MasterCaseMinUnits] & " - " & [MasterCaseMaxUnits])

When I run my report, the control displays: #Type!

Does anyone have any idea what I might have done wrong?

Thanks!
 

boblarson

Smeghead
Local time
Today, 04:18
Joined
Jan 12, 2001
Messages
32,059
How about this:

=IIf(Len([MasterCasemaxUnits] & "") = 0,[MasterCaseMinUnits],[MasterCaseMinUnits] & " - " & [MasterCaseMaxUnits])
 

brharrii

Registered User.
Local time
Today, 04:18
Joined
May 15, 2012
Messages
272
Worked perfectly, thank you :)
 

Users who are viewing this thread

Top Bottom