Sorry for the delay in the reply. Here is the error:
This:
'Start the loop
Loop Until RecCount = 0
RecCount = rstTemp.RecordCount - 1
rstTemp.MoveFirst
If Quote = True And ConfirmedOrder = False Then
Quote = False And ConfirmedOrder = True
Loop
Should be this:
'Start the loop
Do Until RecCount = 0
RecCount = rstTemp.RecordCount - 1
rstTemp.MoveFirst
If Quote = True And ConfirmedOrder = False Then
Quote = False And ConfirmedOrder = True
End If
Loop
This doesn't look right, though. If you start this loop, you are only acting on the first record in the recordset, time after time, until you decrement the RecCount variable.
Perhaps you mean this:
'Start the loop
rstTemp.MoveFirst 'moved
Do Until RecCount = 0
RecCount = rstTemp.RecordCount - 1
If Quote = True And ConfirmedOrder = False Then
Quote = False And ConfirmedOrder = True
End If
rstTemp.MoveNext 'added
Loop
I am not sure if you can act on a DAO recordset as you do in the If Then conditional, but you wouldn't accomplish anything in ADO this way.
Did any of that help?
mmcdonal
|