A year ago I asked about having a subform in a form and only displaying the newest with a group of item prices. See: http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=1319 I made the code as described: In table 28 Item Price
**Function MyFind(Which : Text[250]) : Boolean**
SETCURRENTKEY(
"Item No.","Variant Code","Responsibility Center","Price Group Code",
"Unit of Measure Code","Currency Code","Starting Date");
SETRANGE("Item No.", "Item No.");
IF FIND(Which) THEN BEGIN
SETRANGE("Price Group Code","Price Group Code");
SETRANGE("Currency Code","Currency Code");
FIND('+');
SETRANGE("Price Group Code");
SETRANGE("Currency Code");
EXIT(TRUE);
END ELSE
EXIT(FALSE);
**Function MyNext(Steps : Integer) : Integer**
SETRANGE("Item No.", "Item No.");
SETCURRENTKEY(
"Item No.","Variant Code","Responsibility Center","Price Group Code",
"Unit of Measure Code","Currency Code","Starting Date");
MySteps := 0;
StepsMade := 0;
IF (Steps < 0) THEN BEGIN
REPEAT
SETRANGE("Price Group Code","Price Group Code");
SETRANGE("Currency Code","Currency Code");
FIND('-');
SETRANGE("Price Group Code");
SETRANGE("Currency Code");
StepsMade := NEXT(-1);
MySteps -= StepsMade;
UNTIL (Steps = MySteps) OR (StepsMade = 0);
END ELSE BEGIN
REPEAT
SETRANGE("Price Group Code","Price Group Code");
SETRANGE("Currency Code","Currency Code");
FIND('+');
SETRANGE("Price Group Code");
SETRANGE("Currency Code");
StepsMade := NEXT(1);
MySteps += StepsMade;
UNTIL (Steps = MySteps) OR (StepsMade = 0);
END;
IF StepsMade <> 0 THEN BEGIN
SETRANGE("Price Group Code","Price Group Code");
SETRANGE("Currency Code","Currency Code");
FIND('+');
SETRANGE("Price Group Code");
SETRANGE("Currency Code");
END;
EXIT(MySteps);
In subform:
**OnFindRecord(Which : Text[1024]) : Boolean**
t.COPY(Rec);
IF NOT t.MyFind(Which) THEN
EXIT(FALSE);
Rec := t;
EXIT(TRUE);
**OnNextRecord(Steps : Integer) : Integer**
t.COPY(Rec);
i := t.MyNext(Steps);
IF i <> 0 THEN
Rec := t
ELSE
CLEAR(Rec);
EXIT(i);
In version 2.01 it worked fine! Now upgraded to Attain 3.10 it will not work. It only displays one instances of every Item Price Group and if there aremore, then it gives an error. Does any have a clue?? [8)]