In my part of code (see bottom) I needed add command "SELECT JEDNA_A" before command DBSETFILTER because without it I got runtime error "Area not in use". I dont understand it.
use (pracadr+"jedna_a.dbf") index ex_temp alias jedna_a new
sel_val := win_exp_dav_1A.combo_1.value
hodnota = ex_kody_lek[sel_val]
if sel_val > 1
select jedna_a
dbsetfilter({|| lekar = hodnota} , "lekar = hodnota")
else
dbclearfilter()
endif
In my part of code (see bottom) I needed add command "SELECT JEDNA_A" before command DBSETFILTER because without it I got runtime error "Area not in use". I dont understand it.
use (pracadr+"jedna_a.dbf") index ex_temp alias jedna_a new
sel_val := win_exp_dav_1A.combo_1.value
hodnota = ex_kody_lek[sel_val]
if sel_val > 1
select jedna_a
dbsetfilter({|| lekar = hodnota} , "lekar = hodnota")
else
dbclearfilter()
endif
Thanks for your answers.
Jozef
It's strange, because workarea JEDNA_A should stay selected after USE command.
You can use this code:
I found out that problem started when I put MSGBOX before command "IF" to test value of variable hodnota. Is it possible that msgbox change workarea?
Without msgbox command it is working well.
Jozef