display -ve number in report in this format: (-1)

L

Lim Heng Sin

i have a text box in a report. The value calculated is
from query. The value calculated can be positive number
and negative number. Now what i want to do is when the
calculated value is negative number, it will be display on
this format
(-1)
(-10)

Can i know how to do it and where should i put the code?
I tried something like that but it doesn't work. I put
this code on

Dim strDueDay As String
strDueDay = Me!txtDueDay
If strDueDay < 0 Then
strDueDay = "(" & strDueDay & ")"
End If

On Open event but id doesn't work.
 
C

chas

Hi Lim,

put the following into the Format property of the TextBox
control:

#,##0;(-#,##0)

hth

chas
 

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