G
Guest
I have a form with a subform "qMainCodeInYearSubform". A user selects a YEAR
in the ComboBox causing the AfterUpdate Event to run. This event causes the
subform to be requeried with the YEAR selected. Then with RECORDSETCLONE, I
loop through the records putting each record in a messagebox. It works for
the first time around but not the second. The EOF the second time around
stays TRUE. When another YEAR is selected I would like to loop again through
the new set of record results.
Thanks for any help.
Private Sub cmbYear_AfterUpdate()
Me.qMainCodeInYear_subform.Requery
Dim rst As Recordset, intI As Integer
Dim fld As Field
Set rst = Form_qMainCodeInYearSubform.RecordsetClone
Do While (Not (rst.EOF))
MsgBox rst![MAINT_CODE]
rst.MoveNext
Loop
rst.Close
End Sub
in the ComboBox causing the AfterUpdate Event to run. This event causes the
subform to be requeried with the YEAR selected. Then with RECORDSETCLONE, I
loop through the records putting each record in a messagebox. It works for
the first time around but not the second. The EOF the second time around
stays TRUE. When another YEAR is selected I would like to loop again through
the new set of record results.
Thanks for any help.
Private Sub cmbYear_AfterUpdate()
Me.qMainCodeInYear_subform.Requery
Dim rst As Recordset, intI As Integer
Dim fld As Field
Set rst = Form_qMainCodeInYearSubform.RecordsetClone
Do While (Not (rst.EOF))
MsgBox rst![MAINT_CODE]
rst.MoveNext
Loop
rst.Close
End Sub