Troubleshoot combining text values

3divine

Registered User.
Local time
Today, 16:59
Joined
Apr 24, 2001
Messages
37
Hi

I have this expression in one of my textbox in a form:

="CA" & [lbxCuttingTools].[Column](0)
& IIf(IsNull([txtInsertDesc]),"","-"
& [lbxInserts].[Column](0))
& IIf(IsNull([txtAdapter]),"","-"
& [lstAdapterResult].[Column](0))

[Column](0} always equates to the Primary key

When testing my form with records that I know does not contain a value, in this case, txtInsertDesc, the output was not what I wanted. For example I was getting one too many dashes.

This is what i have as a result: CA934--276

Am I missing something in my expression?
 
My guess would be that your field contains nothing but is not <b>null</b>. I have never really understood the full difference of the two but solve the issue by using the Nz property. I would change your code to look like this:

="CA" & [lbxCuttingTools].[Column](0)
& IIf(IsNull(Nz([txtInsertDesc])),"","-"
& [lbxInserts].[Column](0))
& IIf(IsNull(Nz([txtAdapter])),"","-"
& [lstAdapterResult].[Column](0))


(I put what I added in bold)

[This message has been edited by shacket (edited 10-17-2001).]
 
Hello

Thank you for your reply but sadly still have the same problem ;(
 
shacket,

I guess I resolved my problem just by referencing the Partnumber field straight away.


smile.gif




[This message has been edited by 3divine (edited 10-18-2001).]
 

Users who are viewing this thread

Back
Top Bottom