Hide text box if equal to $0.00?

  • Thread starter Thread starter Crispywafers
  • Start date Start date
C

Crispywafers

Need some help-- tried to research the answer but all the stuff I
tried didn't work.

Have an Invoice report for students. When the price field is
calculated and comes out to $0.00 I just want that text box either to
be hidden or the "$0.00" not to show up so it appears blank.

Code for the text box is:

Name: txtExtendedDayT
ControlSource: =PrintExtendedDayT([Dismissal],[Grade],[EarlyBird],[Discount])
Format: (blank)


PrintExtendedDayT Function Code:

'Prints out extended day tuition on statement

Function PrintExtendedDayT(varDismissal As String, VarGrade As String,
VarEarlyBird As Boolean, VarDiscount As Boolean) As String

Call TuitionCalc(varDismissal, VarGrade, VarEarlyBird, VarDiscount)

If varDismissal = "6:00" Then

curExtendedDayT = mcurExtendedDayYearly

Else

curExtendedDayT = 0

End If

PrintExtendedDayT = FormatCurrency(curExtendedDayT)

End Function




Help??

I've tried sticking $#,##0.00;($#,##0.00);"";"" in the format field
of the text box... $0.00 stil shows up!

Help!
 
Crispywafers said:
Need some help-- tried to research the answer but all the stuff I
tried didn't work.

Have an Invoice report for students. When the price field is
calculated and comes out to $0.00 I just want that text box either to
be hidden or the "$0.00" not to show up so it appears blank.

Code for the text box is:

Name: txtExtendedDayT
ControlSource: =PrintExtendedDayT([Dismissal],[Grade],[EarlyBird],[Discount])
Format: (blank)


PrintExtendedDayT Function Code:

'Prints out extended day tuition on statement

Function PrintExtendedDayT(varDismissal As String, VarGrade As String,
VarEarlyBird As Boolean, VarDiscount As Boolean) As String

Call TuitionCalc(varDismissal, VarGrade, VarEarlyBird, VarDiscount)

If varDismissal = "6:00" Then

curExtendedDayT = mcurExtendedDayYearly

Else

curExtendedDayT = 0

End If

PrintExtendedDayT = FormatCurrency(curExtendedDayT)

End Function

I've tried sticking $#,##0.00;($#,##0.00);"";"" in the format field
of the text box... $0.00 stil shows up!


Your function returns a string that already has the $0.00 in
it, so trying to get the text box to format it again is a
waste of effort. You need to use the custom format in the
function.

Alternatively, change the function to return the numeric
value (remove the Format function) and then you can let the
text box use its Format property.
 
I apologize ahead of time for knowing nothing...

but how do I do the custom format in the function?

Thanks!


Marshall Barton said:
Crispywafers said:
Need some help-- tried to research the answer but all the stuff I
tried didn't work.

Have an Invoice report for students. When the price field is
calculated and comes out to $0.00 I just want that text box either to
be hidden or the "$0.00" not to show up so it appears blank.

Code for the text box is:

Name: txtExtendedDayT
ControlSource: =PrintExtendedDayT([Dismissal],[Grade],[EarlyBird],[Discount])
Format: (blank)


PrintExtendedDayT Function Code:

'Prints out extended day tuition on statement

Function PrintExtendedDayT(varDismissal As String, VarGrade As String,
VarEarlyBird As Boolean, VarDiscount As Boolean) As String

Call TuitionCalc(varDismissal, VarGrade, VarEarlyBird, VarDiscount)

If varDismissal = "6:00" Then

curExtendedDayT = mcurExtendedDayYearly

Else

curExtendedDayT = 0

End If

PrintExtendedDayT = FormatCurrency(curExtendedDayT)

End Function

I've tried sticking $#,##0.00;($#,##0.00);"";"" in the format field
of the text box... $0.00 stil shows up!


Your function returns a string that already has the $0.00 in
it, so trying to get the text box to format it again is a
waste of effort. You need to use the custom format in the
function.

Alternatively, change the function to return the numeric
value (remove the Format function) and then you can let the
text box use its Format property.
 
Back
Top