
I am trying to show the SOheader.user2 field in the sales orders grid. It seems to mostly work as I can see the data behind the error message - what am I missing?
i import the dh file for SOheader and declare public csr_xSOheader. (put the x in there becuase I thought SL might by useing that name for bsoheadbuf)
In the Form Code:
Public MemHandle As Integer
Public MemMaintFlg As Integer
Dim MemFetch As Integer
Private Sub Form1_Display()
MemHandle = GetGridHandle("spdSalesOrder")
serr1 = VBA_Mextend(MemHandle, bSOHeader, LenB(bSOHeader))
End Sub
Private Sub Form1_Load()
Call VBA_SetAddr("bSOHeader", bSOHeader, nSOHeader, LenB(bSOHeader))
Call SqlCursorEx(csr_xSOHeader, NOLEVEL, "csr_xSOHeader", "SOHeader", "SOHeader")
End Sub
Private Sub txtSOHDInvtID_Chk(ChkStrg As String, retval As Integer)
Dim SQLStr As String
MemFetch = MFirst(memhandle_spdSalesOrder, MemMaintFlg)
Do While MemFetch = 0
bSOHeader = nSOHeader
OrdNbr = GetObjectValue("txtSOOrdNbr")
SQLStr = "select * from SOHeader WHERE ordnbr = " + SParm(OrdNbr)
serr1 = SqlFetch1(csr_xSOHeader, SQLStr, bSOHeader, LenB(bSOHeader))
Call MUpdate(memhandle_spdSalesOrder)
MemFetch = MNext(memhandle_spdSalesOrder, MemMaintFlg)
Loop
End Sub
Thanks,
Ayrin
*This post is locked for comments
I have the same question (0)Two possibilities come to mind.
The simplest is to do an mDisplay after your "Loop" statement.
The other is a slightly more elaborate version.
Before you do the mFirst, obtain the current grid row number (Offhand I don't recall the API which does that)
Then after the "Loop" statement, use the API (can't remember its name either!) to set back to that row number, then do the mDisplay.
Barry