Remove "#Error" from form control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lewe22
    New Member
    • Sep 2007
    • 94

    Remove "#Error" from form control

    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?
  • Lewe22
    New Member
    • Sep 2007
    • 94

    #2
    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)
    Code:
    =[Forms]![frmDistLearnByStudMain]![[B][I]frmDistLearnByStudCalculatePrevSessTotalHours[/I][/B]]![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?

    Comment

    • Lewe22
      New Member
      • Sep 2007
      • 94

      #3
      Discovered that HasData can only be used for Reports.

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

      Comment

      Working...