How to set a custom default value on report or VBA Code for this?

A

Adnan

How do I do this with VBA code?:
If txt1 and txt2 is = 0.0 display nothing, if else display whatever this
else is.

Thank you,
Adnan
 
D

Douglas J. Steele

Display nothing where? Are you saying that if txt1 = 0.0, not to display
txt1, and if txt2 = 0.0, not to display txt2, or are you saying if txt1 +
txt2 = 0.0, don't display something?

For the first, you could set the Format property of the textbox to something
like #,##0.00;(#,##0.00)[Red];"";"Null"

For the second, you'd have to put code in the Format event of whatever
section contains what you're trying to hide, along the lines of:

Me.TextboxToHide.Visible = (txt1 + txt2 <> 0.0)
 
A

Adnan

Doug,
The first one is my answer --- and that’s exactly what I needed --- you guys
are more then MVPs. Appreciate your help, your time and most of all your
quick response.

THANK YOU! :)

Adnan


--
Please post all your inquiries on this community so we can all benefit -
Thank you!


Douglas J. Steele said:
Display nothing where? Are you saying that if txt1 = 0.0, not to display
txt1, and if txt2 = 0.0, not to display txt2, or are you saying if txt1 +
txt2 = 0.0, don't display something?

For the first, you could set the Format property of the textbox to something
like #,##0.00;(#,##0.00)[Red];"";"Null"

For the second, you'd have to put code in the Format event of whatever
section contains what you're trying to hide, along the lines of:

Me.TextboxToHide.Visible = (txt1 + txt2 <> 0.0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top