Scrolling records thru c/front

Dear friends, After connecting to the Navision database thru C/FRONT from VB 6.0 i am able to find out first and last records of a given table. But i want to scroll records (Previous , Next) i couldn’t able to do this with many functions.If anybody knows how to write code to scroll please mail the same … thanx in advance rajasekhar venumala

Function NextRec(ByVal hTable As Long, ByVal hRec As Long, ByVal Step As Short) As Short This functions the same as record.Next in C/AL.

Dear Van Dam, My problem is not with Nextrec function. My problem is i am not able to retrieve the current record which is on the VB form to go to the nextrecord or previous record with regards, rajasekhar venumala

I am not sure what you mean. You have a control on a VB form which shows a Navision record and now you want the control to show the next / previous Navision record?

Dear Van Dam, As my VB is not loaded well i didn’t get with nextrec function.The same code is working in another machine… Do u have any idea how can i Modify the primary key (That is renaming record in navision) thru C/FRONT Regards, Rajasekhar Venumala

I don’t think renaming is possible with C/FRONT. May be you can insert a new record with the key you, copy the remaining fields and delete the original record?

Dear Raja, Try this , it is working fine at my end, you can move next , previous,first,last record Dim cf As New CFRONT Dim TableNo As Long Dim TableRef As Long Dim FieldNo As Long Dim Rec As Long Set cf = CreateObject(“cfront.cfrontctrl.1”) cf.OpenDatabase “C:\Program Files\Navision Attain\Client\database.fdb”, 10000, False cf.OpenCompany “CRONUS UK Ltd.” TableNo = 18 cf.OpenTable TableRef, TableNo Rec = cf.AllocRec(TableRef) cf.FindRec TableRef, Rec, “-” MsgBox cf.GetFieldData(TableRef, Rec, 2) cf.NextRec TableRef, Rec, 1 MsgBox cf.GetFieldData(TableRef, Rec, 2) cf.NextRec TableRef, Rec, -1 '(To move previous record) MsgBox cf.GetFieldData(TableRef, Rec, 2) if you face any error pls let me know