某dbcheckbox的checkedvalue值为true,uncheckedvalued为false,对应的字段为select。现在希望判断该checkbox是否被选中,使用了以下代码
   if Adoquery1.fieldbyname('select').asstring = 'true' then ...
但无论dbcheckbox有无选上,都不会执行then后的语句,请问是什么原因?

解决方案 »

  1.   

    dbcheckbox失去焦点后,它是否勾选对应的值才会反映到数据集中。—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————
      

  2.   

    if DBCheckBox1.Checked then ...
      

  3.   

    应该这样写:
    如果数据post:
      if Adoquery1.fieldbyname('select').asboolean =true then ...
    如果没有post
    if DBCheckBox1.Checked then...