Got it.
Very helpful!
Thanks...
Ron

-----Original Message-----
From: FileMaker Pro Discussions [mailto:[email protected]] On
Behalf Of Jason L DeLooze
Sent: Monday, December 29, 2008 12:38 PM
To: [email protected]
Subject: Re: Can't make Find work

Hi Ron,

First of all - a minor point: you do not need the "Show All Records" before
entering Find Mode; FMP will search all records, not just those in the
Current (Found) Set.

The real problem is that your stored Find Request places the string

"= $vmaillistentry"

into the MailList::MailList field.  You, however, want it to place the
actual value stored in the $vmaillistentry variable; therefore, you cannot
use a stored Find Request.  Furthermore, since you have the value already in
a global field [MailList::gMailListEntry], there is no need to also store it
in the $vmaillistentry variable.

Here's a correct script, based on your script:

MailListLabels
 
#Do Find on MailListLabels layout based on Maillist code selected on menu
 
Set Variable [ $vmaillistentry; Value:MailList::gMailListEntry ]
Go to Layout [ "MailList" (MailList) ]
Enter Find Mode [ ]
Set Field [ MailList::MailList ;  "=" & $vmaillistentry ]
Perform Find []
Go to Layout [ "MailListLabels" (MailList) ]
Enter Preview Mode

[I would, of course, do some error trapping and handling in the script ... ]

Note the difference between the criteria

"= $vmaillistentry"

and the criteria

"=" & $vmaillistentry

The 1st one is simply the text constant string "= $vmaillistentry", while
the 2nd one is a (calculated) expression which places an "=" and the current
value in the $vmaillistentry variable as the criteria.  It is this second
(dynamic) expression you need, the the first (static) one.

BTW - you are using the "=" search operator, specifying that you want a
"whole word" match

Best wishes,
Jason L. DeLooze
Annapolis, MD  USA


On 12/29/08 at 10:59 AM -0500, Ron wrote:
> I have a relation of MailList to Mailist_Household, based on HouseholdID.
> MailList holds a code for a specific mail list, for a specific household,
where a Household may be on many lists and there ar of course many
Households.
> I also put a global field gMailListentry in it.
>  
> I have a menu-type layout which has a pull-down list of the mailing codes:
the layout is based on MailList and the pull-down is pointed at the global
field.
> When an entry has been selected, and thus inserted into the global field,
I have a button which calls a script:
>  
> MailListLabels
>  
> #Do Find on MailListLabels layout based on Maillist code selected on menu
>  
> Set Variable [ $vmaillistentry; Value:MailList::gMailListEntry ]
> Go to Layout [ "MailList" (MailList) ]
> Show All Records
> Enter Find Mode [ ]
> Perform Find [ Specified Find Requests: Find Records; Criteria:
MailList::MailList: "= $vmaillistentry" ]
> [ Restore ]
> Go to Layout [ "MailListLabels" (MailList) ]
> Enter Preview Mode
>  
> The Find always returns zero records.
>  
> What am I doing wrong?
>  
> Many thanks.
> Ron Carr

Reply via email to