#ERROR

Harry Taylor

Registered User.
Local time
Today, 21:22
Joined
Jul 10, 2012
Messages
90
Noob Question.
I have this control source in a text box;

=([Enquirymaster100 subform].[Form]![REF NO])

When the result is blank I get an #Error message.

How can I say if blank return blank?
 
I think Excel has ISERROR() but not sure if Access does. Otherwise, you may have to use an IIf() statement.
 
I made a function similar to NZ, called NZB() Null to Blank

USAGE:
= NZB([Enquirymaster100 subform].[Form]![REF NO])

Code:
Public Function NZB(ByVal pvVal)
On Error Resume Next
Select Case True
   Case IsNull(pvVal)
        NzB = NZ(pvVal, "")
   Case Else
      NzB = pvVal
End Select
End Function
 
Rename the control (e. g. textbox) from [REF NO] to txtREFNO ... then the data access runs via the AccessField element.

=[Enquirymaster100 subform]![REF NO] => should work
=[Enquirymaster100 subform]![txtREFNO] => #Error
 

Users who are viewing this thread

Back
Top Bottom