Records Disappeared/Added to the prior Record No 
Author Message
 Records Disappeared/Added to the prior Record No

Hi All!

Using C5a ABC,
I have one MAIN, PRE(MTR) file on a browser which has its secondary file,
SUB, PRE(MSU).  I have updated/selected the MAIN records by mouse-clicking
as follows to report SUB records, not MAIN records;

GET(Queue:Browse,CHOICE(?List))
MTR:ORDNO=Queue:Browse:ORDNO
Access:MAIN.Fetch(MTR:ORDNO_KEY)
    CASE MTR:MARK
    OF '1'
        MTR:MARK=''
    OF ''
        MSU:ORDNO=MTR:ORDNO
        Access:SUB.Fetch(MSU:ORDNO_KEY)
        IF ~ERROR() AND MSU:ORDNO=MTR:ORDNO
            MTR:MARK='1'
        END
    END
    Relate:MAIN.Update()
    BRW1.ResetSort(1)
END

Back to the browser, after printing the report, one of the SUB records moved
to prior or next record No, in case Update/Insert record; even if only
open/close the Form window.  Maybe it's because of the record Opened has not
been disk-written??

Please give me your helping hand.
TIA

JH



Wed, 03 Jul 2002 03:00:00 GMT  
 Records Disappeared/Added to the prior Record No
I'm not sure this will help with your problem; sounds like it is probably
somewhere else (the code here has nothing to do with writing SUB records),
but...

The top three lines of what you have should be replaced by
BRW1.UpdateViewRecord ...a safer (and the ABC standard) way of getting a
record you want to write back to disk.

Then the check of the SUb record should be

if not access:sub.tryfetch
    MTR:MARK='1'
end

tryfetch because you probably don't really need to blank the record, and the
return varlue from fetch and tryfetch is a more reliable way of knowing you
have found a record than using errorcode. Also, this is not going to work if
ORDNO_KEY has more than one component.

Whatever, this code will definitely fool up your SUB record if you are
counting on trhe record and the pointer staying intact during this
operation, so consider if that is a problem when this code is run.

HTH

Jon


Quote:
> Hi All!

> Using C5a ABC,
> I have one MAIN, PRE(MTR) file on a browser which has its secondary file,
> SUB, PRE(MSU).  I have updated/selected the MAIN records by mouse-clicking
> as follows to report SUB records, not MAIN records;

> GET(Queue:Browse,CHOICE(?List))
> MTR:ORDNO=Queue:Browse:ORDNO
> Access:MAIN.Fetch(MTR:ORDNO_KEY)
>     CASE MTR:MARK
>     OF '1'
>         MTR:MARK=''
>     OF ''
>         MSU:ORDNO=MTR:ORDNO
>         Access:SUB.Fetch(MSU:ORDNO_KEY)
>         IF ~ERROR() AND MSU:ORDNO=MTR:ORDNO
>             MTR:MARK='1'
>         END
>     END
>     Relate:MAIN.Update()
>     BRW1.ResetSort(1)
> END

> Back to the browser, after printing the report, one of the SUB records
moved
> to prior or next record No, in case Update/Insert record; even if only
> open/close the Form window.  Maybe it's because of the record Opened has
not
> been disk-written??

> Please give me your helping hand.
> TIA

> JH



Thu, 04 Jul 2002 03:00:00 GMT  
 Records Disappeared/Added to the prior Record No
Hi Jon!

Thanks for your tidbit.  I will check it out your comments line by line.

Anyhow I have solved the problem by not accessing(writing) the files, I mean
using Queue.

JH



Fri, 05 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Prime record fields on insert - Before adding auto incremented record

2. Add Child Record Within New Parent Record form.

3. Adding child records for a newly inserted parent record (CW2003)

4. Prior to Record Update Embed (Method?)

5. Prior Records

6. disappearing records

7. Problems with disappearing data records

8. Disappearing records

9. CW2.003 - mysterious disappearing records

10. Disappearing records, Help!

11. Records disappearing addition!!!!!!!!!!!!!

12. Records disappearing!!!!!!!!!!!

 

 
Powered by phpBB® Forum Software