Jump to content

Selecting a Certain Number of Records


This topic is 5768 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a 50,000 name mailing list DBF. I want to be able to select a range of zip codes for mailing, AND the number of records to find (or export.) I have the zip code range selection figured out, and I have provided a numeric Global field to enter the total number of records to find or export. This is where I hit the wall.

How do I set FMP to find (or export) only a certain number of records within a found set?

Link to comment
Share on other sites

Lets say your table is called "Depts" and the global field with the number you'd like to export is "g_Field" you may set up your script as follows:

Go to layout[my_export_layout]

Perform Find []

If [get(foundcount)=0]

Show custom dialog ["Error!!"; "No records match your criteria"]

Show all records

Go to layout[original]

Exit script

Else

Go to record [(Depts::g_Field)+1]

Omit multiple Records ["99999999999"]

Go to record [first]

Export records[]

Go to layout [original]

you can also replace line 5 with:

Omit multiple Records [Get(Foundcount)- Depts::g_Field+1]

Edited by Guest
Link to comment
Share on other sites

I got it working, thanks to you pointing me in the right direction. I ended up doing it a little differently than you suggested, but it now works exactly like I wanted it to.

I was even able to get the program to automatically give me the number of records asked for by using

Omit Multiple Records[Get ( FoundCount ) - NumberToBeMailed] as the calculated number for the Omit Multiple Records step.

Thanks, Breezer!

Edited by Guest
Link to comment
Share on other sites

This topic is 5768 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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