This program is only for use as a demonstration when working with
recordsets. The idea is that the record set s processed to determine how
many books out by junior, adult and senior members of a library. The
Form_Open event presents the correct totals.
Private Sub Form_Open(Cancel As Integer)
Dim totj As Integer, tota As Integer, tots As Integer
Call OpenRecSet
Do
If Rec("Memb_Cat") = 1 Then
totj = totj + Val(Rec("Memb_BooksOut"))
ElseIf Rec("Memb_Cat") = 2 Then
Tota = Tota + Val(Rec("Memb_BooksOut"))
Else
tots = tots + Val(Rec("Memb_BooksOut"))
End If
Rec.MoveNext
Loop Until Rec.EOF
Me.Txt_JBooks = totj
Me.Txt_ABooks = tota
Me.Txt_SBooks = tots
Rec.Close
However when a new rec is entered and the Memb_BooksOut_AfterUpdate() event
triggered when the BooksOut field is updated, the totals on the form are not
immediately refreshed. Why?
Private Sub Memb_BooksOut_AfterUpdate()
.. same code as above, but ending in .
Me.Refresh
End Sub
Any help given will be genuinely appreciated