levi777 Posted September 30, 2005 Posted September 30, 2005 First, big thanks to everyone on these boards. I didn't even know filemaker existed two weeks ago until I got this new job, but I've learned a lot from lurking.... Now for a possibly easy question, I searched to no avail... I have a report that I want to create for only one state. Is there a way that when the user clicks on the button to perform the script filemaker can prompt them for which state they want to do the report on? I'm sure I'm missing something here. Brain farts all morning....
mr_vodka Posted September 30, 2005 Posted September 30, 2005 You can have a Dialog Box popup and point to a global field under 'Input fields'. However, an easier interface might be to have a srop down box with the states next to the button, or another layout that has a listing of all the states. When they click on the state, it will bring them to the report. P.S. Keep in mind that drop down boxes are not available from the dialog box unless you use a plugin.
levi777 Posted September 30, 2005 Author Posted September 30, 2005 (edited) Hmmm. Not sure I truly understand this and I've been doing a lot of research. Perhaps I need to find a book. I decided to use your idea of a dropdown box to choose the state and a button. When I press the button it runs a script that does a find, but what I don't understand is how to tell filemaker that I only want the report to show records from a particular state, and this report will often be for different states. Is this where parameters come into play? I haven't really grasped the whole parameter idea. I know that I want to pass the state to the script as a parameter, but can't figure it out. Do I need to set up a field to store the parameter? Thanks again. Edited September 30, 2005 by Guest
stanley Posted September 30, 2005 Posted September 30, 2005 Levi777: Welcome to the Forums. To elaborate on John's suggestion, and on the work you've done: The dropdown box you're using should be a global field - that is, a text field with storage set to Global Storage. Then, in your script, you can use the global data to do your find in your actual state field. For the example, let's call your current table "yourDB", the global field "gState", and the state field (where your state data is stored) "tState". Your script would contain: Enter Find Mode[] Set Field[yourDB::tState; yourDB::gState] Perform Find[] So what you're doing is entering Find Mode, setting the field to be searched, then performing the find. After that you can go to the correct layout, etc. Now, that's the old way to do it, before script parameters, but it still works fine, and is simplest to understand. Passing parameters can wait until next time. -Stanley
levi777 Posted September 30, 2005 Author Posted September 30, 2005 Enter Find Mode[] Set Field[yourDB::tState; yourDB::gState] Perform Find[] Hey Stanley, thanks for your help. I know that this is very basic, but I'm still not able to get it to work. A script that would have took seconds to make in sql has pretty much drained me. I now understand how it should work, but the second line set field - how do you enter two fields into it (tstate and gstate). I was only able to enter one. Sorry if this is frustrating for you guys, I'm trying...
-Queue- Posted September 30, 2005 Posted September 30, 2005 The first parameter (before the semicolon) in the Set Field step is the target field. The second parameter (after the semicolon) is the calculation to enter.
levi777 Posted September 30, 2005 Author Posted September 30, 2005 Wow, my bad... Thanks for straightening that out for me. My weekend will no longer be spent thinking about filemaker. Thanks all of you that helped out.
Recommended Posts
This topic is 6996 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now