Dutch,
Below is an example. You will also need the fwh\samples\states.dbf data file.
James
/*
Program : DBC1.PRG
Purpose : Test DBCombo
Notes :
*/
#include "fivewin.ch"
#include "dbcombo.ch"
function main()
local oDlg, oDBC1, oDBC2, cVar, oCust, cStateID:=" ", oBtn, cState:=""
local cDept:= space(3), oStates, aItems, aList
field NAME
if file("states.dbf")
use states
index on upper(NAME) to temp
database oStates
else
msgInfo("File states.dbf not found.")
endif
define dialog oDlg
@ 10,30 dbcombo oDBC1 var cStateID of oDlg;
alias oStates:cAlias;
size 100,200 pixel;
itemfield "CODE" ;
listfield "NAME";
ON CHANGE msgbeep();
update;
aList:= {"Accounting","HR","Marketing","Production","Research","Shipping","Sales"}
aItems:= {"100","200","400","300","600","500","700"}
@ 30,30 DBCOMBO oDBC2 VAR cDept;
items aItems;
size 100,200 pixel;
list aList;
of oDlg;
update
@ 50, 50 button oBtn prompt "Selected";
of oDlg pixel action (odbc1:Select( 5 ), eval( oDBC1:bChange) ) default
// action msgInfo( "cStateId: " +cStateID +CRLF+"DeptNo: "+cDept,"Selected" );
// default
@ 60,100 button oBtn2 prompt "sdfs" of oDlg action msgInfo( cStateID ) pixel
activate dialog oDlg center;
ferase("temp.ntx")
return nil
// EOF