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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
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)
 
Back
Top