error!#@ debug!# etc in report.

  • Thread starter Thread starter manish
  • Start date Start date
M

manish

hi,
i have a report based on 3 queries. the problem is that
sometimes one query may not have any records. when this
happens the report shows error, debug message box. because
i am using a vba function for changing the currency format
to our own indian format. when there is data in the query
the report is fine. but when there is no data i have to
click the 'end button' four times after which the report
comes but the place where data should be is written as
#error. please help me to solve this problem.

regards
manish
 
Hi manish

Referring to a text box that does not exist generates the error. Your
function will have to accept a Variant, since that is the only type that can
be Error. It will need to test if the input is Error, and/or use error
handling.

Example:
Function ShowSpecialFormat(varMoney As Variant) As Variant
'Initialize to return a Null if anthing goes wrong.
ShowSpecialFormat = Null

'Test for Error, and then check it is numeric.
If Not IsError(varMoney) Then
If IsNumeric(varMoney) Then
ShowSpecialFormat = "Whatever it's supposed to output."
End If
End If
End Function
 
Dear Allen
Firstly thanks for the help. but the thing is that i do
not know any thing about coding. so please if you could
tell me exactly where to place the codes.
The fields in the related crosstab-query are
date
particulars
bank
amt
please if u could supply me the code and tell me the place
to put it into - it would be very kind of u.
regards
manish
 
Hi manish

Your original post said:
i am using a vba function for changing the currency format

If you do not have a VBA function, then the suggestions I made will not
help.
 
Back
Top