March 23, 200322 yr I am trying to omit some records that are classed as stolen or BER (Beyond Economical Repair) before I do a stocktake for my school. Can anyone help me with this code as it is driving me crazy Go To Layout ["Notes"] Go To Field ["Status"] If ["Status = "BER" or "Stolen"] Omit Record Go to Record/Request/Page[Exit after last, Next] Loop End Loop End If Many Thanx Poida
March 23, 200322 yr Hi Poida, CloseTry this one. Show All Records Go to Layout [ Notes ] Enter Find Mode Set Field [ Status , "BER" ] Omit Record New Record/Request Set Field [ Status , "Stolen" ] Omit Record Perform Find HTH Lee
March 24, 200322 yr Poida: The problem with your script is that when you use an "and" or an "or", you need to restate everything, so it should read: If(Status="BER" or Status="Stolen", etc.
March 24, 200322 yr Author Thanx all for your help Im still not having much luck though Ive posted the script Im using as a jpeg The script will only omit 13 records with the value of BER or stolen there are another 10 or 12 records which are BER or stolen which are not omitted for some reason Its driving me crazy Any help would be really appreciated
March 24, 200322 yr Author Sorry though I could post an image of the script for people to see Here it is Go To Layout [Notes] If [status = "Stolen" or Status = "BER" Omit Record End If Go To Record/Request/Page[Exit after last, Next] Perform Script[subscripts, "Omit BER or Stolen"
March 24, 200322 yr Do some records have both BER and Stolen in the same field? If so you might want to use the PatternCount function. I think Lee's suggestion using Finds would do the job, but if you want to loop through them all... Show All Records Go to Record/Request [first] Loop If [PatternCount(Status, "BER") > 0 or PatternCount(Status, "Stolen") > 0] Omit Record Else Go to Record/Request [Next] End If Exit Loop If [status(CurrentRecordNumber) = Status(CurrentFoundCount) or Status(CurrentFoundCount) = 0] End Loop If [status(CurrentFoundCount) > 0 Perform Script[subscripts, "Omit BER or Stolen"] Else Beep Show Message ["Everything was BER or Stolen.", OK] End If Watch the logic here: if a record is omitted there is no need to do a "go to the next record" because we're already on the next record. We need to exit the loop if we're on the last record or there are no records left in the found set. Also, the script at the end should only be run if some records weren't omitted.
Create an account or sign in to comment