Trim Function

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

Guest

I have the below expression within a Text Box on an Access 2000 form in order
to hide the text if one of the fields is blank.

It works well except where the fields in the Table are in a currency format
which results in #Error

=Trim("Thank you for your deposit of "+[Dep_Amount]+" . Please forward the
balance of "+[Balance]+" at settlement")

Any suggestions would be greatly appreciated

Thanks Sean.
 
Hi,
I have the below expression within a Text Box on an Access 2000 form
in order to hide the text if one of the fields is blank.

It works well except where the fields in the Table are in a currency
format which results in #Error

=Trim("Thank you for your deposit of "+[Dep_Amount]+" . Please
forward the balance of "+[Balance]+" at settlement")

Any suggestions would be greatly appreciated

Try:

="Thank you for your deposit of " & Format(Nz([Dep_Amount];0); #,#0.00") &
" . Please forward the balance of " & Format(Nz([Balance];0); #,#0.00") & " at settlement")

All in one Line.

Acki
 
Use the ampersand for concatenation, rather than the plus.

Also, try changing the Name property of the text box. The currency type is
probably not the issue here, but Access gets confused if you have a control
that has the same name as a field but is bound to something else.

If you want to see the text containing the currency format, try:
="Thank you for your deposit of " & Format([Dep_Amount], "Currency") & " .
Please forward the balance of " & Format([Balance], Currency") & " at
settlement."

If that still does not work for you, try adding text boxes for Dep_Amount
and Balance to your report. Set their Visible property to No if you don't
want them shown. Sometimes that's the only way to get a report to recognise
them.
 
Back
Top