glaser_david Posted April 10, 2002 Posted April 10, 2002 My layout shows a list of records. I need to omit all records on that list that have a certain value in a field. I wrote a script for that: go to first record loop if fieldX = AAA omit record end if go to record next end loop
glaser_david Posted April 10, 2002 Author Posted April 10, 2002 sorry, posted too quick. Anyway, this script ommits only every other record. i have to perform the script many times for all my records to be omited. Every time i perform it a little more are omitted untill they finally get all omited. if i replace the omit record step by a set field step, all my records get updated correctly. The problem is just with the omit record. Any Idea where it might come from? Thanks, David
kenneth2k1 Posted April 10, 2002 Posted April 10, 2002 Hello David! I might be able to help you with that, since I ran into this problem once, too. You can do this two ways, although I suggest doing it the last way I explain: To get it to work the way you have it now, it needs to be like this: Go to first record Loop If [FieldX = AAA] Omit record Go to Record/request/page [Next] Else If [status(CurrentRecordNumber)=Status(CurrentFoundCount)] Omit Record Exit Loop If ["1"] End If End If end loop I haven't tested it yet, but im pretty sure it will work this way. Its kinda bulky, though. I would suggest this: Enter Find Mode [] Set Field [FieldX , "AAA"] Perform Find Omit Record If [status(CurrentFoundCount)=0] Show Message ["No records matched your request"] Show All Records Hope that does it for ya!! Ken
kenneth2k1 Posted April 10, 2002 Posted April 10, 2002 Oops: I caught a mistake upon proof reading the post: After the "Set Field [FieldX, "AAA"]" step, put the "Omit Record" step. Then have the perform find. That should work. I tried it myself. Ken
kenneth2k1 Posted April 10, 2002 Posted April 10, 2002 Oh, yeah and one more thing: Take out the "IF [status(CurrentFoundCount) = 0]" step. I accidentally left it in there from another script I was working on. Sorry. This is a perfect example of bugs from not checking your scripts!! Learn from my negligence Ken
Recommended Posts
This topic is 8267 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