#Error message in my report

C

CAM

Hello,

I am doing a bank reconcillation in access I have a field call DIT my
problem is if there is no DIT present I get an #Error message. If there is
a number present it should show the number or if there is no DIT I want to
show a zero in the text box. I don't want to get #Error message showing.
Also, should I do the coding in a query level and what will the coding be
in the query? How do I fix this? Thank you in advance.

Cheers
 
A

Allen Browne

Try setting the Control Source of the text box to an expression like this:
=IIf([Report].[HasData], Nz([DIT],0), 0)

Make sure the Name property of this text box is not the same as any field
name in the report. For example, you can call it txtDIT, but not DIT.
 
T

Tom Wickerath

Hi Cam,

You can try using the Nz function. The syntax is:

Nz(variant, [valueifnull])

So, the control source for your text box might look like this:

=Nz([DIT], 0)

To learn more about this function, open any code module. Then click on View
Object Browser (or press the F2 key). Enter Nz as your search term. You
should see a listing for Access. Select this, and then click on the button
with the question mark to open context-sensitive Help.

Also, you may find this KB article helpful. Disregard the "ACC 2000:" in the
title of the article:

Troubleshooting Tips for Error Values
http://support.microsoft.com/kb/209132


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
C

CAM

Tom,

Thanks for the tip I will give it a try, appreciate the help.

Cheers

Tom Wickerath said:
Hi Cam,

You can try using the Nz function. The syntax is:

Nz(variant, [valueifnull])

So, the control source for your text box might look like this:

=Nz([DIT], 0)

To learn more about this function, open any code module. Then click on
View
Object Browser (or press the F2 key). Enter Nz as your search term. You
should see a listing for Access. Select this, and then click on the button
with the question mark to open context-sensitive Help.

Also, you may find this KB article helpful. Disregard the "ACC 2000:" in
the
title of the article:

Troubleshooting Tips for Error Values
http://support.microsoft.com/kb/209132


Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

CAM said:
Hello,

I am doing a bank reconcillation in access I have a field call DIT my
problem is if there is no DIT present I get an #Error message. If there
is
a number present it should show the number or if there is no DIT I want
to
show a zero in the text box. I don't want to get #Error message showing.
Also, should I do the coding in a query level and what will the coding
be
in the query? How do I fix this? Thank you in advance.

Cheers
 
Top