Quote:Mark -
The first suggestion works just fine. Although there are 6 fields involved, it is easy enough to copy and paste the spec into each field, using the Search Option of "meet any restriction."
Be careful when cutting and pasting from the forum, in that the forum software can insert linefeeds and spaces that you do not want.
Quote:I was, however, thinking of something along the lines of your second suggestion. I can follow the code except for the last line because I don't see where "Zip" comes in. I would appreciate knowing what this means.
Its the LE name of the LE I was using (in Customers.db) to test the spec. Use the appropriate LE names from your form in its place.
Quote:Also, I have not tried it but assume it will work (your say-so is good enough for me). But I was also wondering why I would have to use it in "on retrieve spec open."
I thought we could use programming for retrieve specs by enclosing the code in French Curly Braces {} and putting it in the appropriate layout element. That's a feature I am eager to start focusing on.
On retrieve spec open programming runs when the retrieve spec opens and includes the entire SBasic language. You can use it to write into the retrieve spec form itself. It is often used to make retrieve specs dynamic based on information that has already been collected. For example, if you want a user named "Bob" to search for last names that only start with "A", you could write a retrieve spec open program that checks which user is logged in:
if(@User = "Bob")
{
LastName = "A.."
}
When Bob opens the retrieve spec form, the program will run, it will check if this is Bob, and if it is, it will write "A.." into the LastName LE on the retrieve spec form. If Bob then hits F10, Sesame will search for records that have a LE "LastName" that starts with the letter "A".
In short, its a way to create retrieve specs dynamically.
Retrieve programming (in the curly braces), on the other hand, is a subset of SBasic and must result in an expression. It is sent from client to the server, where it is run by the actual data engine on the server for each record. There , the expression is either checked for "truthfulness" (i.e.: "{MyField = YourField}"), or it is checked against a field in each record (i.e.: "={YourField}", placed in the MyLE LE). The important things to remember about retrieve spec programs is that thery are run on the server for each record, that they use
field names as opposed to LE names, and that there are two legal syntaxes: ={expression}, that checks the field it appears in against the result of the expression, and {expression} that simply checks if the expression is true.
So if you have a date LE, you could put:
={@Date}
in that LE and it will check the field against the current date. Or you could put:
{MyDateField = @Date}
in any LE, and the engine will check the field "MyDateField" against today's date.
Quote:Thanks!