Jump to content

What Am I Doing Wrong??


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

Recommended Posts

Ok, Ive made a script for a procedure described in the post, "CHECKING FIELD FOR ENTRY." I couldn't do it the way vaughan had showed me (sorry). So here is what I made:

Perform Find [Restore find requests]

Loop

If [is Empty (Campaign1)]

Insert Text [select, "Campaign1","Auto"]

Insert Current Date [select, "Campaign1 Date"]

Insert Text [select, "Letters1","Intro"]

Insert Current Date [select, "Letters P Date1"]

Else

If [isEmpty (Campaign4)]

Insert Text [select, "Campaign2","Auto"]

Insert Current Date [select, "Campaign2 Date"]

Insert Text [select, "Letters1.1","Intro"]

Insert Current Date [select, "Letters P Date 1.1"]

End If

End If

End Loop

When I perform this script, it will insert the desired text into BOTH sets of fields per IF function on ONE record (or so it appears), instead of inserting it once per record, then loop to the next record. Also, the Apple Button symbol replaces the pointer and a dot flashes at the bottom right of the symbol. Is there something wrong with this script? What should I change to make it work the way I want?

Link to comment
Share on other sites

If it is after the End Loop, you will never reach it. It must be before the end loop. The idea is that the loop proceeds through all the records performing the Inserts, then exits after the last record has been processed. You might also want to place a "Go to Record/Request/Page (first)" before the Loop statement. It is not strictly necessary in this case, but it is a good habit to get into.

-bd

Link to comment
Share on other sites

Use Status(CurrentDate) instead of Today. The Today function only calculates at the start of each session when the database is opened. So if the file is left open for a week then the calculations that use Today will be wrong. FM Inc recommend that if the Today function is used then the file should be closed and reopened once a day, like just after midnight.

The Status(CurrentDate) function re-calculates itself whenever it is used.

Link to comment
Share on other sites

This topic is 7338 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.