dbTalk Databases Forums  

Pls help find requests

comp.databases.filemaker comp.databases.filemaker


Discuss Pls help find requests in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Erik
 
Posts: n/a

Default Pls help find requests - 08-22-2005 , 12:56 AM






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.

I'm using FM Pro 7.0v.1

Thanks,

Erik


Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 01:16 AM






In article <5noig1dc1hcmkfgv95v9vq3kfggrrdt9qo (AT) 4ax (DOT) com>, Erik
<mainNOstreetSPAMmanPLS (AT) hotmail (DOT) com> wrote:

Quote:
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)


Reply With Quote
  #3  
Old   
Erik
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 02:32 AM



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:

Quote:
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)

Reply With Quote
  #4  
Old   
Dan
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 05:05 AM



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:
Quote:
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)
--
Dan
Using
FMP7.03, WinXP SP2




Reply With Quote
  #5  
Old   
Erik
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 05:51 AM



Thanks Dan, that did the trick.

Erik


On Mon, 22 Aug 2005 11:05:49 +0100, "Dan" <dan (AT) owlsnet (DOT) co.uk> wrote:

Quote:
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)

Reply With Quote
  #6  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 04:10 PM



In article <haudnXCdpcPjPpTeRVnysA (AT) brightview (DOT) com>, "Dan"
<dan (AT) owlsnet (DOT) co.uk> wrote:

Quote:
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]
Thanks for that. I keep forgetting that FileMaker 7 has changed Status
to Get and has changed some of the function names. \

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #7  
Old   
Lynn allen
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 04:43 PM



Dan <dan (AT) owlsnet (DOT) co.uk> wrote:

Quote:
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
--
Allen & Allen Semiotics www.semiotics.com
FSA Associate Filemaker Design & Consulting


Reply With Quote
  #8  
Old   
Dan
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 05:30 PM



Lynn allen wrote:
Quote:
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
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?

It raises another interesting question - how does FMP7 pick on the error
number if there is more than one error?

--
Dan
Using
FMP7.03, WinXP SP2




Reply With Quote
  #9  
Old   
Lynn allen
 
Posts: n/a

Default Re: Pls help find requests - 08-22-2005 , 07:22 PM



Dan <dan (AT) owlsnet (DOT) co.uk> wrote:

Quote:
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
--
Allen & Allen Semiotics www.semiotics.com
FSA Associate Filemaker Design & Consulting


Reply With Quote
  #10  
Old   
Dan
 
Posts: n/a

Default Re: Pls help find requests - 08-23-2005 , 03:24 AM



Thanks - I'm convinced.
The purpose in checking for one particular error is to produce an
appropriate message but clearly there are circumstances in which the 401
check is not enough to say that the find has failed to find any records.
In any case on the basis of what you are saying not checking for other
possible errors could leave the user
with an empty found set which is the situation you are trying to avoid.


Lynn allen wrote:
Quote:
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
--
Dan
Using
FMP7.03, WinXP SP2




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.