-
Solved: Add Caption problem
I have the following vb Line that is giving me an error when caption is "".
[VBA]
LblPrice.Caption = Format(CDbl(LblPrice1.Caption) + CDbl(LblPrice2.Caption) + CDbl(LblPrice3.Caption), "$#,##0.00")
[/VBA]
What do I need to do for it to give me the sum even if 1 or more caption's are "" ?
-
Wrap each one in an IIf statement, like this:
[VBA]IIf(Len(LblPrice1.Caption)=0,0,LblPrice1.Caption)[/VBA]
Do this for LblPrice2 and LblPrice3 as well.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules