Concatenation Error

Lanason

Registered User.
Local time
Today, 07:05
Joined
Sep 12, 2003
Messages
258
I am displaying two filed in a form but they are mutually exclusive so I want which ever has data

when I display the fields individually [System] or [Software Name]) I don't get an error

when I do this =IIf([Category]="GB",[System],[Software Name]) I get #error

when I do this =IIf([Category]="GB","GB","Not GB") works fine

What am I doing wrong ???
 
Are you doing this on the form or in the underlying query for the form?
I would suggest the latter is the best way forwards.

MyDisplayField : IIf([Category]="GB",[System],[Software Name])
 
I'm am doing in the form --- let me try in query
 
you get error because the fields are not in the form.
use query as suggested or add the fields and make their visible property to No.
 
worked fine in the query many thanks
 
If the fields are mutually exclusive it means that it is possible to store invalid data in your table by having data in both. Good table design avoids such conundrums.

One way around this is to store the values in the same field. The control label on the form could be changed depending on the Category.

This may not be the ideal solution either. It would be interesting to know more about your data and table structure. You might be heading down a less than optimum track in the big picture.
 

Users who are viewing this thread

Back
Top Bottom