Ms Access 2010 accdb
The age old issue of dealing with a continuous form when there may be no records.
This is a SubForm. I have nearly resolved the issue by adding an unbound text box control on the form footer and code to the On Current event of the form.
If I enter the main form and select a date that has no records in the subform, the correct result appears - $0.00.
If I enter a date where records exist, the correct value result ie the =Sum(... works.
However... If I then select a date with no records, I get nothing ie, the $0.00 does not rsult.
What could be happening here ? Could the fact that there were records be tricking the If Then statement to assume records when there are none ?
The age old issue of dealing with a continuous form when there may be no records.
This is a SubForm. I have nearly resolved the issue by adding an unbound text box control on the form footer and code to the On Current event of the form.
Code:
If Not (Me.Recordset.BOF And Me.Recordset.EOF) Then
Me!txtRefinanceAmountSum.ControlSource = "=Sum([RefinanceAmount])" 'records exit
Else
Me.txtRefinanceAmountSum = 0 'no records so use Zero
End If
If I enter the main form and select a date that has no records in the subform, the correct result appears - $0.00.
If I enter a date where records exist, the correct value result ie the =Sum(... works.
However... If I then select a date with no records, I get nothing ie, the $0.00 does not rsult.
What could be happening here ? Could the fact that there were records be tricking the If Then statement to assume records when there are none ?