Advertisement

07.03.2008 at 02:24PM PDT, ID: 23538238
[x]
Attachment Details

FindNext in a loop - Access

Asked by Karl001 in Access Coding/Macros

I am using the findnext method and for each  record found, I take an action.
It's seem, that I have an infinitive loop.
Do I have to use the Movenext instruction with a findnext ?

Private Sub Formateur_Click()
    Dim dbs As DAO.Database
    Dim rsQuery As DAO.Recordset
    Dim strDay As String
    Dim f As Form
   
    Set dbs = CurrentDb
    Set rsQuery = dbs.OpenRecordset("rq_Formateur2", dbOpenDynaset)
    Set f = Me
   
    rsQuery.FindFirst "[Formateur] Like 'Chabot, Carole-Marie'"
   
    Do While Not rsQuery.EOF
        If Not rsQuery.NoMatch Then
            strDay = "F1J" & Day(rsQuery.Fields!dateDebutHeure)
            f(strDay).Value = rsQuery.Fields!Acti
        End If
       
        rsQuery.FindNext "[Formateur] Like 'Chabot, Carole-Marie'"
    Loop
         
End Sub

Thanks,
Carol
Start Free Trial
[+][-]07.03.2008 at 02:38PM PDT, ID: 21929409

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Access Coding/Macros
Sign Up Now!
Solution Provided By: Rick_Rickards
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628