Connecting Tech Pros Worldwide Forums | Help | Site Map

Remove "#Error" from form control

Member
 
Join Date: Sep 2007
Posts: 94
#1: Jul 11 '08
I am wondering if anyone knows a way of representing a "#Error" shown on a form in a text box as 0?

I realise this is not the most logical thing to do but does anyone know if it's possible. Perhaps using an if statement?

Member
 
Join Date: Sep 2007
Posts: 94
#2: Jul 11 '08

re: Remove "#Error" from form control


A little more information...

My text box is pulling data through from a sub report and currently has the following code in its control source:
(subreport name is in bold italic)
Expand|Select|Wrap|Line Numbers
  1. =[Forms]![frmDistLearnByStudMain]![frmDistLearnByStudCalculatePrevSessTotalHours]![txtDuration]
I am receiving the #Error when the sub report contains no data.

I have done some research and have discovered that i need to incorporate the HasData property into an IIF statement but am really struggling with the syntax.

Can anyone help me please?
Member
 
Join Date: Sep 2007
Posts: 94
#3: Jul 11 '08

re: Remove "#Error" from form control


Discovered that HasData can only be used for Reports.

I fixed this by creating and then calling the function suggested here:

http://www.mvps.org/access/forms/frm0022.htm
Reply