When no records are found... 
Author Message
 When no records are found...
Hoping some of you folk can help, I want to run an if statement within
a script for when there are no records found, to exit the script. But
I just cant seem to think my way around this one.

Can anyone tell me a way to do this....
BFN
OOROO
Michelle



Thu, 18 Jan 2001 03:00:00 GMT
 When no records are found...


Quote:

>Hoping some of you folk can help, I want to run an if statement within
>a script for when there are no records found, to exit the script. But
>I just cant seem to think my way around this one.

>Can anyone tell me a way to do this....
>BFN
>OOROO
>Michelle

Hello Michelle,

    What you need to do is to add the script step,"Set Error Capture[on]".
Now when there is no record found the annoying message will not show up and
you can use the Status script step to check for the no record found. If you
need more help let me know.

Have fun.

Lui W.
__________________________________________________
Note: Remove "NOSPAM_" before replying.
__________________________________________________



Thu, 18 Jan 2001 03:00:00 GMT
 When no records are found...
Hi Michelle,

First, add a Set Error Capture [On] step to your script somewhere preceding
the Find step.  That prevents the FileMaker dialog that appears when no
records can be found.

Second add an If[] step to check found count results.  Something like:

If [(not Status( CurrentFoundCount ))]
   Show Message ["No records match your request. Sorry!"]
   Exit Script
Else
   Comment ["Do normal stuff here, or after the End If"]
End If

Good luck,

Andrew LeCates
--------------


Quote:

>Hoping some of you folk can help, I want to run an if statement within
>a script for when there are no records found, to exit the script. But
>I just cant seem to think my way around this one.

>Can anyone tell me a way to do this....
>BFN
>OOROO
>Michelle



Thu, 18 Jan 2001 03:00:00 GMT
 When no records are found...
Michelle,

Here's my favorite solution for this one,

Set Error Capture [On]
-insert your find step(s) here-
If ["Status( CurrentError) = 401"]
    Exit Script
End If

Error 401 = No records match this request

Vince

Quote:

>Hoping some of you folk can help, I want to run an if statement within
>a script for when there are no records found, to exit the script. But
>I just cant seem to think my way around this one.

>Can anyone tell me a way to do this....
>BFN
>OOROO
>Michelle



Mon, 22 Jan 2001 03:00:00 GMT
 When no records are found...

Quote:

>Michelle,

>Here's my favorite solution for this one,

>Set Error Capture [On]
>-insert your find step(s) here-
>If ["Status( CurrentError) = 401"]

For better readability you can use also :
if ("Status(CurrentFoundCount) = 0")

Quote:
>    Exit Script
>End If

>Error 401 = No records match this request

>Vince


>>Hoping some of you folk can help, I want to run an if statement within
>>a script for when there are no records found, to exit the script. But
>>I just cant seem to think my way around this one.

>>Can anyone tell me a way to do this....
>>BFN
>>OOROO
>>Michelle

eRTS Telecom                             Tel : 31-561-441746
R.Th.Smakman                             Fax : 31-561-441556

NL-8330 AD S{*filter*}wijk                     The Netherlands


Tue, 23 Jan 2001 03:00:00 GMT
 When no records are found...

If you script a error capture for a null found set its helpful to display
a message and give the user the option to try again or exit. Also keep in
mind that an unsuccessful find will result in another error message
prompting the creation of a new record when the user returns to a layout,
so it is best to exit the find with a find all.

if ("Status(CurrentFoundCount) = 0")
Display message"No matching records found"[Try Again][Cancel]
if(status(CurrentMessageChoice)=2
  find all
  goto layout "list"
  exit script
else
  goto layout "find layout"
  enter find mode [pause]
end if

Since you are going to the trouble of scripting the null condition you
also might want to add logic to goto a form layout if a single record is
found, and a list if more than one is found by adding:

if ("Status(CurrentFoundCount) > 1")
  goto layout "list"
else
  goto layout "form"
end if


Quote:


>>>Michelle,

>>>Here's my favorite solution for this one,

>>>Set Error Capture [On]
>>>-insert your find step(s) here-
>>>If ["Status( CurrentError) = 401"]
>>For better readability you can use also :
>>if ("Status(CurrentFoundCount) = 0")
>>>    Exit Script
>>>End If

>>>Error 401 = No records match this request

>>>Vince


>>>>Hoping some of you folk can help, I want to run an if statement within
>>>>a script for when there are no records found, to exit the script. But
>>>>I just cant seem to think my way around this one.

>>>>Can anyone tell me a way to do this....
>>>>BFN
>>>>OOROO
>>>>Michelle

>>eRTS Telecom                             Tel : 31-561-441746
>>R.Th.Smakman                             Fax : 31-561-441556

>>NL-8330 AD S{*filter*}wijk                     The Netherlands

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
cgardner-at-nova.org * http://www.***.com/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Fri, 26 Jan 2001 03:00:00 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. I am getting duplicate records, I mean everything is duplicate even Access record number

2. Finding a record without Find/Seek methods...

3. Finding How many records found

4. No found records - stop modify find message

5. Find returns mostly blank fields for first found record (FMP5)

6. Hi,I am newbie,and want to find solution in NT 4.0 with samba

7. HI,I am newbie,and want to find solution between NT 4.0 and samba

8. HI,I am newbie,and want to find solution between NT 4.0 and samba

9. HI,I am newbie,and want to find solution between NT 4.0 and samba

10. I am a dumb, can't find enterprise manager

11. How do I find out what database I am in

12. Finding records(two records have a single field value that is the same)


 
Powered by phpBB® Forum Software