The following code populates a combobox:
WITH THIS.C40cboRev
.SORTED = .F.
.CLEAR()
SELECT v_dma_ondockey
lnRowCount = 1
* We dont want the false revisions ++ to be chosen
* So we will skip those
SCAN FOR v_dma_ondockey.dmarev # '++'
* lets populate our combobox with all the data we will
* need to track master documents
lnNextItem = .NEWITEMID + 1
.ADDLISTITEM(v_dma_ondockey.dmarev, lnNextItem,1)
.ADDLISTITEM(v_dma_ondockey.dccdescrip, lnNextItem,2)
.ADDLISTITEM(v_dma_ondockey.dmalevel, lnNextItem,3)
.ADDLISTITEM(v_dma_ondockey.dstdescrip, lnNextItem,4)
.ADDLISTITEM(DTOC(v_dma_ondockey.dmaaprdate), lnNextItem,5)
.ADDLISTITEM(v_dma_ondockey.dmaaprsign, lnNextItem,6)
.ADDLISTITEM(v_dma_ondockey.dmafnumber, lnNextItem,7)
.ADDLISTITEM(ALLTRIM(STR(docacmds.dockey)), lnNextItem,8)
.ADDLISTITEM(ALLTRIM(STR(v_dma_ondockey.dmakey)), lnNextItem,9)
*
* Lets check to see if the user wishes to go to a specific record, that was chosen
* by using their rightmouse in a list ox
IF THISFORM.nMasterKeyToGoTo # 0
* There is a key to go to so lets see if the one we are processing is the one
* we need to go to
IF v_dma_ondockey.dmakey = THISFORM.nMasterKeyToGoTo
* This is it so lets remember the index and reset the keyflag
nIndexToStartWith = lnNextItem
THISFORM.nMasterKeyToGoTo = 0
ENDIF
ENDIF
ENDSCAN
ENDWITH
Would not the Clear() method above reset the .NEWITEMID property so I can clear out the combo box and add another set of data to choose from?
Bret Hobbs
"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope