Move the MOVENEXT to outside the if block...
Code:Private Sub Form_Load() dcCars.Refresh 'adds cars to list box While Not dcCars.Recordset.EOF 'Only displays cars which aren't on hire If dcCars.Recordset("OnHire") = "No" Then lstCars.AddItem (dcCars.Recordset("Reg")) End If dcCars.Recordset.MoveNext Wend End Sub




Reply With Quote