I tried the referenc you suggested:
Code:
If Len(Forms!frmCollStats!SfrmARsAge.Form.txtAgePercent.Value & vbNullString) = 0 Then
varAging = 0
Else
varAging = Form_SfrmARsAge.txtAgePercent.Value
End If
Unfortunately I cannot post the DB. Let me see if I can explain my dilemma again.
I have a Query that returns results. It is possible for the query to return no results and therefore when the subform loads it loads blank (text boxes do not display or anything). When that occurs I want my variable to be assigned 0, otherwise I want my variable to be assigned the value of the text box on the form. I guess instead of using a form I could run my SQL out of VBA but I'm not well versed in that area. My SQL statement is below.
Code:
SELECT QryZZZOver2yrsOld.Emp, QryZZZOver2yrsOld.Balance AS Over2Yr, Sum(TblARReportYTDReport.EndBal) AS YTDEndBal, [Over2Yr]/[YTDEndBal] AS YTDPct
FROM QryZZZOver2yrsOld INNER JOIN TblARReportYTDReport ON QryZZZOver2yrsOld.Emp = TblARReportYTDReport.RACF_No
GROUP BY QryZZZOver2yrsOld.Emp, QryZZZOver2yrsOld.Balance
HAVING (((QryZZZOver2yrsOld.Emp)=[Forms]![FrmCollStats]![cboRVNum]));