ms access - VBA function that dynamically appends year name -
i have form in access check boxes each year. check boxes named ch+(whatever year) want write run query depends on check boxes, don't want rewrite each box writing function takes year input, checks if year's box checked, runs query if checked.
i tried this:
public function check(year integer) dim boo string boo="me.ch" & year if boo ... end if end function
it appears setting string variable equal name of boolean variable in form want checked doesn't work.
how write function inputs year, , tests if check box in form related year true?
thanks
try this:
public function check(year integer) if me("ch" & cstr(year)).value = true ' stuff. end if end function
Comments
Post a Comment