Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Erratic combobox behavior
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Erratic combobox behavior
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01060242
Message ID:
01060242
Views:
57
I am having trouble understanding the combobox behavior. The combobox is in a grid. The rowsource is an array. Valid event calls a method that auto inserts values from array into row fields. Trouble is it acts intermittently. Some values it always run the method, others (majority) don't. I put a break point in the method and the valid call, neither stops at the point. The cursor advances to the next grid column but does not fill the fields it should and does not stop on the break point. Anyone knows why the combobox behaves this way?
** valid event **
LOCAL lcAcctCode,lnIndex
lcAcctCode = allt(This.listitem(This.ListIndex))
lnIndex = This.ListIndex
IF EMPTY(lcAcctCode) OR lnIndex = 0
    MESSAGEBOX('CANNOT LEAVE ACCOUNT CODE EMPTY',16+0,'INVALID ACCOUNT CODE')
    nodefault
ELSE			
    .m_Update_Acct_Data(lcAcctCode)
    .grdJobData.clmCopier.setFocus
ENDIF && EMPTY(lcAcctCode) OR lnIndex = 0
** m_Update_Acct_Data() method **
lparameters cCode
local nPos, nRow
store 0 to nPos, nRow

with ThisForm
    nPos = ASCAN(.aAccts,cCode) && Search for company
    nRow = aSubscript(.aAccts,nPos,1)
    if nPos != 0
	REPLACE org_code WITH SUBSTR(Trim(.aAccts(nRow,2)),3)
	REPLACE eo WITH .aAccts(nRow,3)
	REPLACE Modl WITH .aAccts(nRow,5)
	REPLACE Grant WITH .aAccts(nRow,6)
	REPLACE Contract WITH .aAccts(nRow,7)
	REPLACE Proj WITH .aAccts(nRow,8)
    endif
endwith
Extreme Programming = Plan -> Design -> Code -> Test
Next
Reply
Map
View

Click here to load this message in the networking platform