Line up and Line Down with out using Mouse

Hi , I would like to move the cursor in the Sales Invoice Subform using Command Buttons,in the Line Up Command Button i have written the following lines of Code : CurrForm.SalesLines.FORM.GETRECORD(SalesLine); SalesLine.SETRANGE(“Document No.”,“No.”); SalesLine.NEXT(-1); Using the above code i am able to get the previous record in the code,but in the form i am not able to move the cursor position from the Current Record to Previuos Record.Does any one have idea about this. Thanks

CurrForm.SalesLines.FORM.SETRECORD(SalesLine); … might come handy :slight_smile: Marcus

Hi Marcus, If we use Form.SETRECORD then system will show a message that Do you want to rename the Record.This property does not work,is there any alternative ? Thanks for your reply.

Create a function in the Sales Invoice Subform, for example “previous” with the following code: next(-1); CurrForm.UPDATE(FALSE); In the Line Up Button you call this funcion with CurrForm.Saleslines.FORM.previous; I have not tested it with the Sales Invoice Form but with another Form-Subform relation and it works fine. Greetings Frank

Hi Frank, Thank you very much,it’s working fine with your idea. Thanks Mohan