G
Guest
Hi,
I have a form with a subform attached to it from the form I run code as below
Public Function CodeVATCal(vatJobCode, vatJobGross)
If vatJobCode Like "CR" Then
CodeVATCal = vatJobGross
Else
CodeVATCal = (vatJobGross / 117.5) * 100
End If
End Function
The works fine however if the recordset of the subform is empty this causes
a runtme error. My question is how can I make the code ignore if the
recordset is empty or has no value.
thanks
Matt
I have a form with a subform attached to it from the form I run code as below
Public Function CodeVATCal(vatJobCode, vatJobGross)
If vatJobCode Like "CR" Then
CodeVATCal = vatJobGross
Else
CodeVATCal = (vatJobGross / 117.5) * 100
End If
End Function
The works fine however if the recordset of the subform is empty this causes
a runtme error. My question is how can I make the code ignore if the
recordset is empty or has no value.
thanks
Matt