Statements Not Finishing before subsequent statements run

I have found another example of statements conflicting with one another because the first statement finishes after subsequent statements have run and finished, resulting in an unexpected result. The firm administrator runs a report of hours. I want to be certain that her database is synced to the server and that there are no duplicate entries. (Today a person was paid for a day of overtime because one computer was not synced to the server.) Here is my code:

Field Initials sortup
Field WorkDate sortupwithin

selectduplicates Initials+" "+WorkDate

if info("empty")
     nsnotify "Confirmed: No Duplicates"
      openform "DisplayDuplicates"


I created a duplicate record and then ran this procedure. Watching the datasheet, I could see the selection of the duplicate, the opening of the form “DiplayDuplicates”, and almost immediately all records were selected. Clearly, the forcesynchronize statement was running after the selectduplicates had finished.

To solve this problem, I am going to try my pause/resume trick with a timer. But this involves some guesswork: how long will it take for forcesynchronize to complete? The db is very large, about 4,000 records, and may grow to as much as 8,000 records with 25 fields, the majority of which are floating point numbers. I will add to my post once that is attempted.

Addition: This problem occurs with a synchronize statement or a forcesynchronize statement.

Ok, I’ve added it to the list.

FYI, unlike the problems dealt with earlier, this is not mysterious. I know exactly what is happening.