I'm not sure I understand what you want. You can leave out the show custom dialog box, but the user wouldn't be able to abort.
If I turn off the custom dialog box off it will not sent an attachment with the email. I apologise, I have a hard time explaning. But let me try again.
We have a report we have to email off everyday. Sometimes there are photos anywhere from one to 20. For the phots I created a seperate Table and created a relationship. This Table is sorted by a Leading Sub-Summary. This allows me to have 1 or 50 photos if i like. However, if there are zero photos for a report, the is an error because there is nothing to find. So, I created a seperate layout with out the Leading Sub Summary.
The only way I could get it to work was to put the custom dialog box in the script. So, now when there are zero photos a message pops up asking thme if they want to contiue with out photos. Which is alright. I would rathger not have the custom dialog box had have the script know what to do.
If there are zero photos- go to layout A
If there are one or more photos- go to layout B
I hope this helps.
I wouldn't use a find here since you already have a relationship setup. Create a summary field, click count, then select a field. It really doesn't matter which field in the photo table you select. This will give you the total number of photo avaliable based on the relationship. Then in your script use this summary field in your if statement.
The problem you are having is with your find statement. If you correct that problem then your script would work without the custom dialog box.
Thank you for your help but while I was trying to your suggestion, and not completley understanding, I came across another way of working around the custom dialog box the.
I used: IF[Get(LastError)=401]
Thank you for your help.