dbTalk Databases Forums  

Find using global variable

comp.databases.filemaker comp.databases.filemaker


Discuss Find using global variable in the comp.databases.filemaker forum.



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

Default Find using global variable - 07-12-2007 , 02:09 PM






I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?


Reply With Quote
  #2  
Old   
Grip
 
Posts: n/a

Default Re: Find using global variable - 07-12-2007 , 02:18 PM






On Jul 12, 1:09 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:
Quote:
I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?
There's global variables and global fields. The Custom Dialog script
step can only allow input into fields, not variables. You can use a
global field for the entry, then set a variable (can be a local $) to
that field and set your find fields off that variable. You could also
just set you find fields off the global field, but depending on the
number of Set Fields you have the former might be faster, it's also
easier to change if the script changes.

G



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

Default Re: Find using global variable - 07-12-2007 , 02:45 PM



On Jul 12, 2:18 pm, Grip <g... (AT) cybermesa (DOT) com> wrote:
Quote:
On Jul 12, 1:09 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:

I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?

There's global variables and global fields. The Custom Dialog script
step can only allow input into fields, not variables. You can use a
global field for the entry, then set a variable (can be a local $) to
that field and set your find fields off that variable. You could also
just set you find fields off the global field, but depending on the
number of Set Fields you have the former might be faster, it's also
easier to change if the script changes.

G
Thanks for the guidance. Here is what I am doing:

Set Error Capture [On]
Allow User Abort [Off]
Go to Layout ["frm_Competative Shopping Detail" (All Competative
Data)]
Show All Records (I don't know if this is necessary, but I want to
make sure what I do will be done on all records, not a subset of
records)
Show Custom Dialog [ Title:"Component Search
Criteria";Message:"Please enter a keyword for the component you want
to find";Buttons: "OK","Cancel";Input#1:All Competative
Data::SearchCrit, "Component"]
If [Get (LastMesssageChoice)=1]
Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
End if (I know I still need to add a part to handle when they
select cancel)
Enter Find Mode [ ]
Set Field [All Competitive Data::Reusbl10=$$Component]
Perform Find [ ]
(I still need to add something in case the find does not return
anything)

This code does not find what I am looking for and it should, I am
using a keyword that I know some records contain. Any idea what I am
doing wrong?
Thanks!



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

Default Re: Find using global variable - 07-12-2007 , 03:16 PM



On Jul 12, 2:45 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:
Quote:
On Jul 12, 2:18 pm, Grip <g... (AT) cybermesa (DOT) com> wrote:





On Jul 12, 1:09 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:

I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?

There's global variables and global fields. The Custom Dialog script
step can only allow input into fields, not variables. You can use a
global field for the entry, then set a variable (can be a local $) to
that field and set your find fields off that variable. You could also
just set you find fields off the global field, but depending on the
number of Set Fields you have the former might be faster, it's also
easier to change if the script changes.

G

Thanks for the guidance. Here is what I am doing:

Set Error Capture [On]
Allow User Abort [Off]
Go to Layout ["frm_Competative Shopping Detail" (All Competative
Data)]
Show All Records (I don't know if this is necessary, but I want to
make sure what I do will be done on all records, not a subset of
records)
Show Custom Dialog [ Title:"Component Search
Criteria";Message:"Please enter a keyword for the component you want
to find";Buttons: "OK","Cancel";Input#1:All Competative
Data::SearchCrit, "Component"]
If [Get (LastMesssageChoice)=1]
Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
End if (I know I still need to add a part to handle when they
select cancel)
Enter Find Mode [ ]
Set Field [All Competitive Data::Reusbl10=$$Component]
Perform Find [ ]
(I still need to add something in case the find does not return
anything)

This code does not find what I am looking for and it should, I am
using a keyword that I know some records contain. Any idea what I am
doing wrong?
Thanks!- Hide quoted text -

- Show quoted text -
I think I figure it out. I am now using the global field instead of
the global variable in the Set Field and it works. However, I need to
do multiple set fields. In other words I need to search about 30
fields for this keyword. Not sure how to do this. Do I do a search
and then do an extended search 29 times?

Thanks



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

Default Re: Find using global variable - 07-12-2007 , 03:57 PM



In article <1184271394.329025.9850 (AT) r34g2000hsd (DOT) googlegroups.com>,
ToppThat <topp_that (AT) yahoo (DOT) com> wrote:

Quote:
On Jul 12, 2:45 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:
On Jul 12, 2:18 pm, Grip <g... (AT) cybermesa (DOT) com> wrote:





On Jul 12, 1:09 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:

I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?

There's global variables and global fields. The Custom Dialog script
step can only allow input into fields, not variables. You can use a
global field for the entry, then set a variable (can be a local $) to
that field and set your find fields off that variable. You could also
just set you find fields off the global field, but depending on the
number of Set Fields you have the former might be faster, it's also
easier to change if the script changes.

G

Thanks for the guidance. Here is what I am doing:

Set Error Capture [On]
Allow User Abort [Off]
Go to Layout ["frm_Competative Shopping Detail" (All Competative
Data)]
Show All Records (I don't know if this is necessary, but I want to
make sure what I do will be done on all records, not a subset of
records)
Show Custom Dialog [ Title:"Component Search
Criteria";Message:"Please enter a keyword for the component you want
to find";Buttons: "OK","Cancel";Input#1:All Competative
Data::SearchCrit, "Component"]
If [Get (LastMesssageChoice)=1]
Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
End if (I know I still need to add a part to handle when they
select cancel)
Enter Find Mode [ ]
Set Field [All Competitive Data::Reusbl10=$$Component]
Perform Find [ ]
(I still need to add something in case the find does not return
anything)

This code does not find what I am looking for and it should, I am
using a keyword that I know some records contain. Any idea what I am
doing wrong?
Thanks!- Hide quoted text -

- Show quoted text -

I think I figure it out. I am now using the global field instead of
the global variable in the Set Field and it works. However, I need to
do multiple set fields. In other words I need to search about 30
fields for this keyword. Not sure how to do this. Do I do a search
and then do an extended search 29 times?

Thanks
Firstly there's a problem in your script above, but It's probably just
a typo in transferring it to the newsgroups.

You've got:
Set Field [All Competitive Data::Reusbl10=$$Component]

which makes no sense (FileMaker should display an error) and should be:

Set Field [All Competitive Data::Reusbl10, $$Component]

The "=" symbol should be a comma.



To find the same keyword in 30 fields you will have to script an
"extended" search, or more precisely an OR search, which is done in the
same way you would perform the search manually - by adding extra Find
requests.
ie.
Enter Find Mode []
Set Field [All Competitive Data::Reusbl10, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl11, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl12, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl13, $$Component]
...
New Record / Request []
Set Field [All Competitive Data::Reusbl40, $$Component]
Perform Find []








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


Reply With Quote
  #6  
Old   
ToppThat
 
Posts: n/a

Default Re: Find using global variable - 07-12-2007 , 04:26 PM



On Jul 12, 3:57 pm, Helpful Harry <helpful_ha... (AT) nom (DOT) de.plume.com>
wrote:
Quote:
In article <1184271394.329025.9... (AT) r34g2000hsd (DOT) googlegroups.com>,





ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:
On Jul 12, 2:45 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:
On Jul 12, 2:18 pm, Grip <g... (AT) cybermesa (DOT) com> wrote:

On Jul 12, 1:09 pm, ToppThat <topp_t... (AT) yahoo (DOT) com> wrote:

I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?

There's global variables and global fields. The Custom Dialog script
step can only allow input into fields, not variables. You can use a
global field for the entry, then set a variable (can be a local $) to
that field and set your find fields off that variable. You could also
just set you find fields off the global field, but depending on the
number of Set Fields you have the former might be faster, it's also
easier to change if the script changes.

G

Thanks for the guidance. Here is what I am doing:

Set Error Capture [On]
Allow User Abort [Off]
Go to Layout ["frm_Competative Shopping Detail" (All Competative
Data)]
Show All Records (I don't know if this is necessary, but I want to
make sure what I do will be done on all records, not a subset of
records)
Show Custom Dialog [ Title:"Component Search
Criteria";Message:"Please enter a keyword for the component you want
to find";Buttons: "OK","Cancel";Input#1:All Competative
Data::SearchCrit, "Component"]
If [Get (LastMesssageChoice)=1]
Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
End if (I know I still need to add a part to handle when they
select cancel)
Enter Find Mode [ ]
Set Field [All Competitive Data::Reusbl10=$$Component]
Perform Find [ ]
(I still need to add something in case the find does not return
anything)

This code does not find what I am looking for and it should, I am
using a keyword that I know some records contain. Any idea what I am
doing wrong?
Thanks!- Hide quoted text -

- Show quoted text -

I think I figure it out. I am now using the global field instead of
the global variable in the Set Field and it works. However, I need to
do multiple set fields. In other words I need to search about 30
fields for this keyword. Not sure how to do this. Do I do a search
and then do an extended search 29 times?

Thanks

Firstly there's a problem in your script above, but It's probably just
a typo in transferring it to the newsgroups.

You've got:
Set Field [All Competitive Data::Reusbl10=$$Component]

which makes no sense (FileMaker should display an error) and should be:

Set Field [All Competitive Data::Reusbl10, $$Component]

The "=" symbol should be a comma.

To find the same keyword in 30 fields you will have to script an
"extended" search, or more precisely an OR search, which is done in the
same way you would perform the search manually - by adding extra Find
requests.
ie.
Enter Find Mode []
Set Field [All Competitive Data::Reusbl10, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl11, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl12, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl13, $$Component]
...
New Record / Request []
Set Field [All Competitive Data::Reusbl40, $$Component]
Perform Find []

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)- Hide quoted text -

- Show quoted text -
Thank You / Thank You / Thank You!!! I have only been working on
this for 2 days! I have it working and now I can go on my vacation
and not keep thinking about this - it was driving me crazy.



Reply With Quote
  #7  
Old   
Guy
 
Posts: n/a

Default Re: Find using global variable - 07-14-2007 , 12:58 PM



Instead of a custom dialog, make a small layout that behaves like a modal
dialog, then you can have several fields, even use pop-up menus, check
boxes, etc.

The pop-up can display only values that have been used (even though there
are many mor ein the pop-up list used by the enter layout).

You can lock a small layout in an new window to not allow the user to close
the box without an explicit cancel or action. The script for that is only 3
steps.

Create new window (name, size)
goto layout (new small layout)
hide and lock status area
allow user abort [off]
loop
pause/resume script [indefinitely]
beep
end loop

then in the find script, besure to add
halt script

Guy









"ToppThat" <topp_that (AT) yahoo (DOT) com> wrote

Quote:
I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?




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.