主题:代码问题
SCAN
nOlm_35=IIF(ISNULL("m_35")=.T.,0,m_35)
nOlm_36=IIF(ISNULL("m_36")=.T.,0,m_36)
nOlm_37=IIF(ISNULL("m_37")=.T.,0,m_37)
SELECT tblStock
LOCATE FOR ALLTRIM(tblstock.product)==ALLTRIM(curin.product)and ALLTRIM(tblstock.color);
==ALLTRIM(curin.color)
IF FOUND()
replace tblstock.m_35 WITH tblstock.m_35+(curin.m_35-nolm_35)
replace tblstock.m_36 WITH tblstock.m_36+(curin.m_36-nolm_36)
replace tblstock.m_37 WITH tblstock.m_37+(curin.m_37-nolm_37)
ELSE
INSERT INTO tblstock (product,color,m_35,m_36,m_37) VALUES ;
(curin.product,curin.color,curin.m_35 ,curin.m_36 ,curin.m_37 )
ENDIF
ENDSCAN
问题是:没找到时,记录输入不进去.
nOlm_35=IIF(ISNULL("m_35")=.T.,0,m_35)
nOlm_36=IIF(ISNULL("m_36")=.T.,0,m_36)
nOlm_37=IIF(ISNULL("m_37")=.T.,0,m_37)
SELECT tblStock
LOCATE FOR ALLTRIM(tblstock.product)==ALLTRIM(curin.product)and ALLTRIM(tblstock.color);
==ALLTRIM(curin.color)
IF FOUND()
replace tblstock.m_35 WITH tblstock.m_35+(curin.m_35-nolm_35)
replace tblstock.m_36 WITH tblstock.m_36+(curin.m_36-nolm_36)
replace tblstock.m_37 WITH tblstock.m_37+(curin.m_37-nolm_37)
ELSE
INSERT INTO tblstock (product,color,m_35,m_36,m_37) VALUES ;
(curin.product,curin.color,curin.m_35 ,curin.m_36 ,curin.m_37 )
ENDIF
ENDSCAN
问题是:没找到时,记录输入不进去.