Ray, et. al. -
I am still having problems with my command button for retrieving a record set and sorting it (although i am happy to say that I am making great progress and am very much encouraged).
First, I would like to point out (just in case it is not self evident) that the reason for all the "save record" commands is that when a record has a date of birth, the age is automatically recalculated, on form entry. In order to ensure that I don't get the "sometimes" message that "my record has changed but not yet been saved," I included the "save" command to preclude the possibility.
Here is the code I am presently using:
var saverecord as Int
var loadretrieve as Int
var doretrieve as Int
var loadsort as Int
var dosort as Int
saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")
loadretrieve = @LoadRetrieveSpec("Paid Subscribers")
saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")
doretrieve = @selecttreeitem("Search Menu!Search Commands!Retrieve New Results (F10)")
saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")
loadsort = @LoadSortSpec("Alphabetical By Last Name")
saverecord = @selecttreeitem("Search Update Menu!Navigation!Save Record")
dosort = @SelectTreeItem("Search Update Menu!Results Commands!Sort")
If @Askuser("You are about to print", @ResultSetTotal() + " envelopes","Do you want to do this?") Then
{
//Run Mass Update
}
STOP
AlternateDefaultPrinter("Envelopes")
PrintPagePaper(20)
Newpage(950,412)
PrintString("Herbert Teicher", 30, 25, 0, "Arial", 14, 0)
PrintString("26 McDonald Street", 30, @PageExtentY(), 0, "Arial", 14, 0)
PrintString("Staten Island, NY 10314-5055", 30, @PageExtentY(), 0, "Arial", 14, 0)
PrintString(Mail Name, 450, 200, 0, "BArial", 16, 0)
PrintString(Street Address + " " + Apt, 450, @PageExtentY(), 0, "BArial", 16, 0)
PrintString(City + ", " + State + " " + Zip, 450, @PageExtentY(), 0, "BArial", 16, 0)
PrintString("Thanks for supporting The Middle Villager Newsletter", 30, 355, 0, "IArial", 12, 0)
FinishPage()
I am having a couple of problems with the retrieve/sort spec.
1) When I press the command button, the appropriate record set is retrieved, however it is not properly sorted. That's my first problem. (I am presented - at this point - with the ask user message telling me the number of envelopes I am about to print and asking if I want to continue).
2) If I click "yes" on the askuser box and then click on the command button a second time, I am presented with the askuser box yet a second time, asking if I want to contnue. By clicking on the command button a second time, the records are then properly sorted.
It seemed to me that perhaps my statements were "out-of-order" so I tried a couple of variations, with no success.
I am eager to get to the actual "print" (mass update) command and would appreciate additional help.
Thanks!