Might help to post your script. Also, check for any script triggers that might kick in during your script's execution and move the focus to the first record. If you have FileMaker Advanced, you can enable the script debugger and run your script a few times while watching it execute step by step as this will show you any such triggers performing scripts should they be a factor here.
To post a script to the forum:
- You can upload a screen shot of your script by clicking the edit link to your original message and uploading it there
- You can upload a screen shot to a file share site and post the download link to a new response you post here.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF.
- If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional look to your script.
A little more context would be helpful.
Its possible that the table occurance reference being used to set the variable is different than that of the current record.
If you could post your script steps and how its being executed it would be helpful.
If you can print the script to a PDF file you can then select the text and copy/paste it. (May require copy and past to a text file first to remove formatting)