![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I have a database of my clients and I have a layout with the letters of the alphabet in the header and "First_Name" field and "Last_Name" field in the body. I want to click on one of the letters, ie. "A" and have FM automatically perform a find request using the letter "A" in "First_Name" field as the find criteria. I've right clicked "A" then "specify button" | "Perform Script" and for "Optional Script Parameter" I have entered "a". This is the script that is run when "A" is clicked: _______ Enter Find Mode [ ] Set Field Name [Names Contact Info::First_Name; Get (ScriptParameter)] _______ This works fine; the letter "A" is put into the field "First_Name" as I expected. However at this point I have to manually press my enter key or click on the find button at the left to continue this find request. How do make the find request continue on it's own once the find criteria has been entered in the field? I can't figure out how to automate it. |
#3
| |||
| |||
|
|
In article <5noig1dc1hcmkfgv95v9vq3kfggrrdt9qo (AT) 4ax (DOT) com>, Erik mainNOstreetSPAMmanPLS (AT) hotmail (DOT) com> wrote: Hello, I have a database of my clients and I have a layout with the letters of the alphabet in the header and "First_Name" field and "Last_Name" field in the body. I want to click on one of the letters, ie. "A" and have FM automatically perform a find request using the letter "A" in "First_Name" field as the find criteria. I've right clicked "A" then "specify button" | "Perform Script" and for "Optional Script Parameter" I have entered "a". This is the script that is run when "A" is clicked: _______ Enter Find Mode [ ] Set Field Name [Names Contact Info::First_Name; Get (ScriptParameter)] _______ This works fine; the letter "A" is put into the field "First_Name" as I expected. However at this point I have to manually press my enter key or click on the find button at the left to continue this find request. How do make the find request continue on it's own once the find criteria has been entered in the field? I can't figure out how to automate it. Easy-peasy. Assuming they haven't renamed the command in FileMaker 7, your script simply gets one extra line: Enter Find Mode [] Set Field Name [Names Contact Info::First_Name; GetScriptParameter)] Perform Find [] The Perform Find command is in the next section of commands underneath where you get Enter Find Mode (or at least it is in older versions of FileMaker). You may or may not also want to add some error checking in there in case there are no "A" names. That would give you something along the lines of: Enter Find Mode [] Set Field Name [Names Contact Info::First_Name; GetScriptParameter)] Set Error Capture [On] Perform Find [] If [Status(CurrentError <> 0)] Beep Message ["There are no names with A"] End If Helpful Harry Hopefully helping harassed humans happily handle handiwork hardships ;o) |
#4
| |||
| |||
|
|
Thank you Harry. "Perform find[]" is what I was missing. Thank you as well for the bit about error checking. I've set "Set Error Capture" to on and now it runs much slicker. I couldn't figure out how to enable the "If...End If" part you suggested, but that's ok. A blank layout for "X" works for me. Thanks again, Erik On Mon, 22 Aug 2005 18:16:34 +1200, Helpful Harry helpful_harry (AT) nom (DOT) de.plume.com> wrote: In article <5noig1dc1hcmkfgv95v9vq3kfggrrdt9qo (AT) 4ax (DOT) com>, Erik mainNOstreetSPAMmanPLS (AT) hotmail (DOT) com> wrote: Hello, I have a database of my clients and I have a layout with the letters of the alphabet in the header and "First_Name" field and "Last_Name" field in the body. I want to click on one of the letters, ie. "A" and have FM automatically perform a find request using the letter "A" in "First_Name" field as the find criteria. I've right clicked "A" then "specify button" | "Perform Script" and for "Optional Script Parameter" I have entered "a". This is the script that is run when "A" is clicked: _______ Enter Find Mode [ ] Set Field Name [Names Contact Info::First_Name; Get (ScriptParameter)] _______ This works fine; the letter "A" is put into the field "First_Name" as I expected. However at this point I have to manually press my enter key or click on the find button at the left to continue this find request. How do make the find request continue on it's own once the find criteria has been entered in the field? I can't figure out how to automate it. Easy-peasy. Assuming they haven't renamed the command in FileMaker 7, your script simply gets one extra line: Enter Find Mode [] Set Field Name [Names Contact Info::First_Name; GetScriptParameter)] Perform Find [] The Perform Find command is in the next section of commands underneath where you get Enter Find Mode (or at least it is in older versions of FileMaker). You may or may not also want to add some error checking in there in case there are no "A" names. That would give you something along the lines of: Enter Find Mode [] Set Field Name [Names Contact Info::First_Name; GetScriptParameter)] Set Error Capture [On] Perform Find [] If [Status(CurrentError <> 0)] Beep Message ["There are no names with A"] End If Helpful Harry Hopefully helping harassed humans happily handle handiwork hardships ;o) |
#5
| |||
| |||
|
|
In version 7 the Status functiuons have been replaced by Get functions so replace the step If [Status(CurrentError <> 0)] by If[Get(LastError) <> 0] or if you want to be certain you are picking up the no matching records error If[Get(LastError) = 401] Erik wrote: Thank you Harry. "Perform find[]" is what I was missing. Thank you as well for the bit about error checking. I've set "Set Error Capture" to on and now it runs much slicker. I couldn't figure out how to enable the "If...End If" part you suggested, but that's ok. A blank layout for "X" works for me. Thanks again, Erik On Mon, 22 Aug 2005 18:16:34 +1200, Helpful Harry helpful_harry (AT) nom (DOT) de.plume.com> wrote: In article <5noig1dc1hcmkfgv95v9vq3kfggrrdt9qo (AT) 4ax (DOT) com>, Erik mainNOstreetSPAMmanPLS (AT) hotmail (DOT) com> wrote: Hello, I have a database of my clients and I have a layout with the letters of the alphabet in the header and "First_Name" field and "Last_Name" field in the body. I want to click on one of the letters, ie. "A" and have FM automatically perform a find request using the letter "A" in "First_Name" field as the find criteria. I've right clicked "A" then "specify button" | "Perform Script" and for "Optional Script Parameter" I have entered "a". This is the script that is run when "A" is clicked: _______ Enter Find Mode [ ] Set Field Name [Names Contact Info::First_Name; Get (ScriptParameter)] _______ This works fine; the letter "A" is put into the field "First_Name" as I expected. However at this point I have to manually press my enter key or click on the find button at the left to continue this find request. How do make the find request continue on it's own once the find criteria has been entered in the field? I can't figure out how to automate it. Easy-peasy. Assuming they haven't renamed the command in FileMaker 7, your script simply gets one extra line: Enter Find Mode [] Set Field Name [Names Contact Info::First_Name; GetScriptParameter)] Perform Find [] The Perform Find command is in the next section of commands underneath where you get Enter Find Mode (or at least it is in older versions of FileMaker). You may or may not also want to add some error checking in there in case there are no "A" names. That would give you something along the lines of: Enter Find Mode [] Set Field Name [Names Contact Info::First_Name; GetScriptParameter)] Set Error Capture [On] Perform Find [] If [Status(CurrentError <> 0)] Beep Message ["There are no names with A"] End If Helpful Harry Hopefully helping harassed humans happily handle handiwork hardships ;o) |
#6
| |||
| |||
|
|
In version 7 the Status functiuons have been replaced by Get functions so replace the step If [Status(CurrentError <> 0)] by If[Get(LastError) <> 0] or if you want to be certain you are picking up the no matching records error If[Get(LastError) = 401] |
\
#7
| |||
| |||
|
|
In version 7 the Status functiuons have been replaced by Get functions so replace the step If [Status(CurrentError <> 0)] by If[Get(LastError) <> 0] or if you want to be certain you are picking up the no matching records error If[Get(LastError) = 401] |
#8
| |||
| |||
|
|
Dan <dan (AT) owlsnet (DOT) co.uk> wrote: In version 7 the Status functiuons have been replaced by Get functions so replace the step If [Status(CurrentError <> 0)] by If[Get(LastError) <> 0] or if you want to be certain you are picking up the no matching records error If[Get(LastError) = 401] It's always safer to use If Get(RecordCount) = 0 than to use the 401 error. Sometimes there are other errors involved in not finding matching records. Lynn Allen |
#9
| |||
| |||
|
|
OK I'm intrigued. You are saying that there are other errors which will result in no matching records but will give an error number not equal to 401? Can you specify? |
#10
| |||
| |||
|
|
Dan <dan (AT) owlsnet (DOT) co.uk> wrote: OK I'm intrigued. You are saying that there are other errors which will result in no matching records but will give an error number not equal to 401? Can you specify? If you're finding in a related field, the related file (table) might be left in Preview mode, which will block the find (or go to related records, for that matter). There are types of data mismatch that will prevent a find from performing. If a related file called in a calculation has not been opened properly (say if a user got the "File Not Found" and dismissed it without specifying a file, all those calculations would not perform properly. I think this may return a different error than 401. The whole point of Set Error Capture (on) is to capture ALL errors, so testing for just one seems imprudent to me. If you go to the list of errors in the FM online help, you'll see that there are quite a few conditions that can interfere with a find. Lynn Allen |
![]() |
| Thread Tools | |
| Display Modes | |
| |