ms access 2007 - Invalid use of null -
i hope last problem have database. wrote code: is averaging group of inputs.
public sub calcoverallrating() dim li_calcvalue integer if isnull((forms![frm_csr]![pp1]!cbx_pp1.value) or _ isnull(forms![frm_csr]![pp2]!cbx_pp2.value) or _ isnull(forms![frm_csr]![pp3]!cbx_pp3.value) or _ isnull(forms![frm_csr]![pp4]!cbx_pp4.value) or _ isnull(forms![frm_csr]![pp5]!cbx_pp5.value) or _ isnull(forms![frm_csr]![pp6]!cbx_pp6.value) or _ isnull(forms![frm_csr]![pp7]!cbx_pp7.value)) 'don't calculate if values null else li_calcvalue = (forms![frm_csr]![pp1]!cbx_pp1.value + _ forms![frm_csr]![pp2]!cbx_pp2.value + _ forms![frm_csr]![pp3]!cbx_pp3.value + _ forms![frm_csr]![pp4]!cbx_pp4.value + _ forms![frm_csr]![pp5]!cbx_pp5.value + _ forms![frm_csr]![pp6]!cbx_pp6.value + _ forms![frm_csr]![pp7]!cbx_pp7.value) / 7 forms![frm_csr].text270.value = li_calcvalue forms![frm_csr].[overall csr].value = li_calcvalue end if end sub
also have call calcoverallrating in each of forms names frm_pp1 through frm_pp7.
when use combobox comes error of invalid use of null. please help
you've included of conditions in first isnull()
function. these should separated conditions:
if isnull(something) or isnull(somethingelse) ...
remove opening , closing parentheses.
Comments
Post a Comment