Question

filter records using value from drop down list

Asked by: c0link

I am running a script to filter records by Year which works well. The only problem is that I have to enter the year in question in the actual script. What I want to be able to do is select a year from a drop down list and have the script filter on that value.

I have included a field Working Year in the underlying table which is on the form as my drop down list. I have also tried setting the filter value = Working Year but it does not work. Suspect this will involve a variable but with my limited knowledge on this front I have not been successful.

Any suggestions?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-02-23 at 22:38:56ID23188106
Tags

Filemaker

,

Filemaker Pro Advanced

,

8.5v1

Topic

FileMaker Pro Database

Participating Experts
1
Points
400
Comments
37

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Filters
    I have a form in VB5 and I want to filter on 4 of the fields on the form could be all the 4 or only one of them. These fields read from a recordset so the final result when I browse through, iwill only see these filtered records. thank you
  2. DataGridView filter - combobox column
    Hello, I am working on implementing a full-text search for a datagridview. Currently, I just use some backgruond logic to create a rowFilter statement and set this into the bindingSource.Filter property of the dataGridView's datasource. This method, however, does not accou...
  3. Filter TDBGrid results not underlying dataset
    I am creating a component that is based on a TDBGrid. I need to be able to filter what appears in the TDBGrid without actually changing the underlying datasource. This is because more than one grid may show different views of the same datasource, each a subset of the origin...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: lesouefPosted on 2008-02-24 at 02:13:57ID: 20969426

make the year field (the popup in main table) GLOBAL.
add it to the relationship used to display related records (provided you have a year field in the sub table; if not make one by extracting the year from the date on subtable side.
to sum up:
existing link:
maintable::id = subtable:id
and you add
main::table = subtable:year (which is year of the date field)

 

by: c0linkPosted on 2008-02-24 at 05:22:40ID: 20969754

Lets assume I want to add a drop down box or text box on my layout that determines which recordset by year I want to display. I have year a field that has extracted the year from the date. The existing record set is based on one main table and displays as a form list and I do not have any portals on the form as to show the records I want it did not seem necessary.

If you were going to implement the drop down list to choose a selection year how would you go about it?

 

by: lesouefPosted on 2008-02-24 at 06:43:55ID: 20970033

you need a self relationship in this case, based on the global year = year fields. but a portal is still required.
to get rid of a portal, you need to filter (search) records upon year field change.
this can only be done with a plug-in to trigger an action after the year has been modified.
www.softs4humans.com
take the EventScript plug-in and use that to seach records when you change the year selection field

 

by: c0linkPosted on 2008-03-01 at 23:34:04ID: 21025267

I am trying to figure this out but getting no where. I have a table called Commissions. I have a layout built around this table which displays records in list form. I have a script which filters and sorts this list layout. There are no portals on this layout because I see no reason that I need one.

One of the fields in the commission table is cYearWritten which is extracted from date written. At the moment my script filters records based on cYearWritten = 2007, where =2007 has to be input and changed by me in the script if I want to show records for a different year or 2007 onwards.

It seems to me that there should be a simple way of adding a field to the layout (drop down list seems logical though at this stage I will settle for simple edit box) that I can reference in the script that will allow me to re-filter the records on my layout when I enter a different year.

When I add a global field my script does not recognise the field.

 

by: lesouefPosted on 2008-03-02 at 03:00:09ID: 21025607

?? something is wrong, it should.
the portal is one of the ways to have an automatic filter without using a script.
if you'd prefer keep the find script, then you need to

find mode
set field cYearWritten = global year
execute

if this does not work, then there is a silly error you read 20 times without seeing it; everybody does that once tired.
also do not forget that calc fields are not searcheable if not stored, so is it a calc field or an auto-entered field based on a calc. made after the real date field?
and last, post me the file if you'd like me to have a look

 

by: c0linkPosted on 2008-03-02 at 04:40:11ID: 21025789

Have sent file on Pagetruck. Easier for me to see what you do by example. I am sure this will be simple after that. Thanks.

 

by: lesouefPosted on 2008-03-02 at 04:55:25ID: 21025822

the file structure is OK, but there is no script to filter according to the Working_year.
am I supposed to to it, or would you like it to work without any script (ie with the plug-in to do it)?

 

by: c0linkPosted on 2008-03-02 at 07:06:53ID: 21026166

if there is a plug in then use that.

There is no specific script for using Working_year as I was trying to incorporate this into the Sort by Written Year script. Where this script has a literal criterium of =2007 or similar parameter I was trying to insert a field ref instead of =2007. Seemed very logical to me but Filemaker doesn't think so.

 

by: lesouefPosted on 2008-03-02 at 07:13:04ID: 21026190

do you want me to modify the sort script to include the search or use the plug-in (must be installed on all client machines)?

 

by: c0linkPosted on 2008-03-06 at 00:27:51ID: 21058320

Just wondering if there is any further development here since downloading the file?

 

by: lesouefPosted on 2008-03-06 at 01:40:40ID: 21058640

no, I had no time and you haven't answered the last question (id 21026190)...

 

by: c0linkPosted on 2008-03-06 at 01:53:39ID: 21058686

I did but it didnt go through for some reason. No problem. The answer is, ideally, I would like it set up using the plug in. I have it on my machine.

 

by: lesouefPosted on 2008-03-06 at 04:53:00ID: 21059622

ok, great, I'll deal with that later on, I have to go now. be patient, a bit too busy by now.

 

by: lesouefPosted on 2008-03-06 at 15:44:24ID: 21065951

file modified to filter upon year popup change
http://www.ee-stuff.com/Expert/Upload/getFile.php?fid=6924

 

by: c0linkPosted on 2008-03-07 at 14:54:02ID: 21074816

On clicking on pop up date get message ' "Working_year" is defined to allow only specific values. Allow this value?'

Revert Field  No  Yes

 

by: c0linkPosted on 2008-03-07 at 14:54:42ID: 21074822

...follow on, whatever option I click it does not sort.

 

by: c0linkPosted on 2008-03-07 at 14:57:23ID: 21074848

in fact, wherever I click, menus, layout options, etc. the message comes up all the time.

 

by: lesouefPosted on 2008-03-07 at 15:05:44ID: 21074908

your plug-in does not work.
I did not include any test to check if it is running.
I could do a startup script to check if present and running maybe?

 

by: lesouefPosted on 2008-03-07 at 15:09:16ID: 21074932

put this in a startup script

if (LeftWords ( S4HU_VersionEventScript ; 2 ) ` "S4HU_EventScript"
show custom dialog= "plugin not installed!"

 

by: c0linkPosted on 2008-03-07 at 15:18:10ID: 21074971

In plug-ins it shows S4HU_EventScript 1.1 Donationware (UB). I take it that this is not capatable now?

 

by: lesouefPosted on 2008-03-07 at 17:04:05ID: 21075381

that looks correct. is it enabled in the prefs? just in case ...
because what you describe is exactly what it does when the plug-in is missing or off.
are you on pc or mac?

 

by: lesouefPosted on 2008-03-07 at 17:06:09ID: 21075387

BTW some signs got corrupted, you should read up there
if (LeftWords ( S4HU_VersionEventScript ; 2 ) [not equal] "S4HU_EventScript" ...
and I am off for today, I am not in the US but in Europe, getting late here...

 

by: c0linkPosted on 2008-03-07 at 17:33:54ID: 21075458

using Mac. Enabled in Prefs. I have checked folders and it is EventScript is there.

 

by: lesouefPosted on 2008-03-08 at 00:52:42ID: 21076371

ah???
there would be a difference?
what I wrote up there is taken from a fm8 app I wrote for a company which was full osX. and is still used by me under windows...
are you sure you've been using my example strait out of the zip?
I'll implement the plug-in check myself to make sure...
and send you the file again

 

by: lesouefPosted on 2008-03-08 at 01:05:13ID: 21076391

http://www.ee-stuff.com/Expert/Upload/getFile.php?fid=6928

this is your file with your startup script modified to check plug-in presence.
will issue a msg if not found, whatever version you use, and report the version if found.

 

by: c0linkPosted on 2008-03-08 at 17:11:54ID: 21079544

message comes up confirming that S4HU_EventScript 1.1 Donationware (UB) is present and that year filtering will work. On clicking pop up box still get message

 ' "Working_year" is defined to allow only specific values. Allow this value?'

Revert Field  No  Yes

This is definitely your most up to date file, so no confusion there. Silly question but I assume it works your end when you test it?

 

by: lesouefPosted on 2008-03-08 at 17:44:01ID: 21079635

of course... so obvisouly something different on mac for v9. do you still have a v8 to test? just to make sure this is the pb.

 

by: c0linkPosted on 2008-03-08 at 21:32:05ID: 21080361

I use FM v8.5, I have not upgraded yet. If this is likely to be the problem I can upgrade.

 

by: lesouefPosted on 2008-03-09 at 01:12:49ID: 21080730

no, I don't think so. there is probably a tiny syntax problem with this version which I don't have, I went strait from 8 to 9.
I am just wondering whether it is worth to report this to Gaston Forgues (plug-in author) or not...
Also, would you have a compatibility problem with another plug-in (happened to me)? Can you try while disabling other plug-ins if any?
I am gonna try another method also, using the calc field instead of the validation. they both work normally, but just in case that would make a difference in your case. I'll post that later on today

 

by: lesouefPosted on 2008-03-09 at 03:34:38ID: 21080849

2nd way if any better
http://www.ee-stuff.com/Expert/Upload/getFile.php?fid=6934
Also works on my machine under v8 and 9.
Can you get it tested by some other person, /osX as well?

 

by: c0linkPosted on 2008-03-09 at 18:53:46ID: 21083637

You are going to hate me on this. When I click pop up, date selected displays with a question mark after the year, i.e. 2007?

Does not sort either.

I upgraded my machine to Panther a few months back, but stayed with FM v8.5. Is it possible that there is some compatibility issue here?

 

by: lesouefPosted on 2008-03-10 at 01:56:14ID: 21084849

no idea, the last mac I've used was back in nov 2006, and under 10.4
can you get it tested on someone else's machine?
the ? after 2007 is normal since the plug-in does not return what's expected in the calc formula.
...
Obviously, you are in a case whihc is not described in the compatibility chart of the plug-in.
First try to run the example file which is delivered with the plug-in.
Then try with the previous version 1.0 if you own a power mac only (1.0 is not Intel compatible).
If the example does not work, then it is worth to send the case to soft4humans as I am stuck.

 

by: c0linkPosted on 2008-03-10 at 02:35:00ID: 31433669

Ok understand. Thanks for your patience with this.

 

by: lesouefPosted on 2008-03-10 at 03:03:23ID: 21085067

but what have you done? you not gonna give up now do you?

 

by: lesouefPosted on 2008-05-03 at 06:25:36ID: 21492234

this old thing... I have a mac now, running fm8 and osX 10.4.11. any interest to counter check things?
eventscript 1.1 works fine on it.

 

by: c0linkPosted on 2008-05-04 at 17:56:16ID: 21497574

I sensed that this wasn't going anywhere. For some reason it did not work on my system but I will go back again revisit this. The database, though simple, is very important to me and my work and if I can improve basic (I would even say rudimentary) functionality like this then all the better. Still amazed that what is such a minor simple routine in MS Access is a major developmental procedure in Filemaker. It is stupid things like this that have stopped me buying upgrades of Filemaker.

Anyway, that whinge aside, I will check the eventscript again and come back to you.

 

by: lesouefPosted on 2008-05-04 at 22:49:05ID: 21498314

ok. I agree on those unacceptable weaknesses from fm.
I suspect them to do it on purpose, a large % of their plugin dev community are also fm resellers.
I am also using servoy now, where the control on the UI is far better.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...