Hi Juan, I have pretty much got the code working except for 2 things :- the labour description only populates in the grid the second time you press the Ok-Load button (still blank after pressing first time) and all the labour descriptions in the grid are the same (last ones labour code used). Here is my code :-
Public CSR_xPJCODE As Integer
Private Sub cmdLoad_Click()
irownum = MGetRowNum(GridHandle)
serr1 = MFirst(GridHandle, MaintFlag)
Do Until serr1 = NOTFOUND
Call GetBufferValue("bpjtran.tr_id05", bxPJCODE.code_value)
ssqlstr = "Select * From PJCODE Where code_value = " & SParm(bxPJCODE.code_value)
serr1 = SqlFetch1(CSR_xPJCODE, ssqlstr, bPJCODE, LenB(bPJCODE))
If serr1 = 0 Then
Call MUpdate(GridHandle)
End If
Call MUpdate(GridHandle)
serr1 = MNext(GridHandle, MaintFlag)
Loop
Call msetrownum(GridHandle, irownum)
Call MDisplay(GridHandle)
End Sub
Private Sub Form1_Display()
GridHandle = GetGridHandle("ssinq")
DelGridHandle = GetDelGridHandle("ssinq")
serr1 = VBA_Mextend(GridHandle, bxPJCODE, LenB(bxPJCODE))
End Sub
Private Sub Form1_Load()
Call VBA_SetAddr("bPJCODE", bPJCODE, nPJCODE, LenB(bPJCODE))
Call SqlCursorEx(CSR_xPJCODE, NOLEVEL, "CSR_xPJCODE", "bxPJCODE", "bxPJCODE")
End Sub