Jump to content
Sign in to follow this  
RexDrawsPears

Setting find parameters to automatically run reports

Recommended Posts

My employer has asked me to create a database for his entire business. I have no prior experience with FM, and now I've hit a wall in my database creation.

I currently have one database with three tables: Employees, Departments, and Time Cards. I have these three tables functioning in the ways I expect; however, I need to create a button to run a report based on data found in the Time Cards Records. There are three fields that I have to match when I run each report, but the value in each field will change from one report to the next. These fields are as follows: DeptType, EmpCode, and PayPeriod. I have set up a box of tabs in the report layout to specify which value I am searching in these three fields.

Here is the problem: I need for this button (with script attached) to take the information I have put in the three fields and pull up all those specific records that match all three criteria without writing a seperate script for each possible value that could be in the three fields.

Can anyone help me?!

Share this post


Link to post
Share on other sites

Not sure if this is what you want but.......

Script:

enter find mode - do not pause

show custom dialog - click on the input fields and add the 3 fields

preform find

:?:)? what'cha ya think ?????????

You'll have to enter the criteria poss. each time. maybe not but I'm working on my own thingy....

Share this post


Link to post
Share on other sites

Welcome to FM Forums, Rex.

I don't know what you mean by "a box of tabs," but the general form of a Find in a script is as Cabinetman noted:

Enter Find mode

    Set Field( someField ; someCriteria )

 Perform Find




Note that when you enter Find and perform Find you do NOT specify any criteria: that is handled by the Set Field step. 



Also note that when you enter Find, you won't have access to field data, except for global fields. So make corresponding global fields for DeptType, EmpCode, and PayPeriod, and then in Find mode use the Set Field step for each one like this (I've made the global fields start with "g": 




Enter Find mode

    Set Field( DeptType ; gDeptType )

    Set Field( EmpCode ; gEmpCode )

    Set Field( PayPeriod ; gPayPeriod )

 Perform Find

Cabinetman's idea will work, but FileMaker dialogs are limited to 3 input fields, and perhaps you don't want to use a dialog, so there you go.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.