access vba - MS Acess loop, adding x to checkbox -
need looping thru check boxes in access. have 3 checkboxes, checkbox1, checkbox2, checkbox3. x = 1 can't syntax loop "check" & x or checkx or check(x) there way declare checkbox name number variable x?
thanks!
private sub refer_click() dim x integer dim y string x = 1 y = "" until x = 4 if checkx = true y = y & checkx.controls(0).caption & ";" x = x + 1 else: x = x + 1 y = "unchecked" end if loop fillthis.value = y end sub
assuming have 10 checkboxes on form, each named "chk" plus sequential number, can use following:
for = 1 10 debug.print me.controls("chk" & i).name & vbtab & me.controls("chk" & i).value next
Comments
Post a Comment