>You code looks simple enough. Are there any filters on the OrderItems table?
>
NO
>Can you pause the program where I inserted a comment and browse for Order_id = lcOrderNum?
I set variables in a watch window of a debug session. Sometimes it matches, sometimes it is 0. I think the c_orders cursor is in a one-to-many relation. If I browse that cursor, I see the extra records with *s.
>Have you confirmed directly after this line that the values are not being written, or could htis be a buffering issue?
The thought has crossed my mind. The base form has buffering set to optimistic. It has a button for Reports, which sets a local variable and passes it to the .prg containing this code. Since the table not being updated has child records, it should be handled as Optimistic Table Buffering, I believe. Wouldn't the ENDSCAN commit the changes as it selects away from the table?
>BTW, per William's suggestion- SCAN does NOT require you to reselect the work area at the end of the loop. In fact, doing so is only a performance hit.
I was counting on that, as I had learned that some time back.
>>Suggestions gratefully accepted....
>>Neil Preston
>>
>>
>>SELECT Orders
>> lcOrdersOldOrder = ORDER()
>> SET ORDER TO order_id
>> SELECT orderitems
>> lcItemsOldOrder = ORDER()
>> SET ORDER TO order_id
>> SELECT c_Orders
>> SCAN
>> lcOrdNum = order_id
>> SELECT Orders
>> SEEK lcOrdNum
>> IF FOUND()
>> REPLACE shipdate WITH DATE()
>> ELSE
>> WAIT WINDOW AT 20,20 ' Order not found '
>> ENDIF
>> SELECT orderitems
>*** Pause here!!!
>> REPLACE shipped WITH DATE() FOR order_id = lcOrdNum
>>
>> ENDSCAN
>>
>>
>>
>
>