MS Access 2010 Object Passing Value instead of Reference ... Sometimes -


i have small bit of code larger ms access database likes behave erratically. can't sure, seems change when compile or recompile database. here's code:

private sub findctls()  dim dattype string dim thisctl control  dattype = right(activecontrol.name, len(activecontrol.name)-4)  each thisctl in me.controls    if instr(1, thisctl.name, dattype, 2) > 0      select case left(thisctl.name,4)        case "sel_"            set tgtctls(0) = thisctl        ' buncha other cases      end select   end if next thisctl  end sub  

the problem is, when step through code, reason thisctl being passed value of control, not control itself. i've looked everywhere answer, brought me using "set" command instead of putting tgtctls(0) = thisctl. worked until decompiled db , recompiled it. made 1 change (changed name of first variable), compiled again, , worked. got work today, told me no longer working. ideas appreciated.

edit: forgot mention tgtctls form-wide array dim'd @ top such:

option compare database dim tgtctls(2) control 


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -