查询如何显示在MSFlexGrid网格控件中的问题。救急!
我用了六个单选按钮(option)和一个checkbox,其中六个option分成两组,三个为一组,用于查询条件的控件。我想让根据不同的复合查询条件,查询出来的的结果显示在网格控件中。
条件结构是:
if option1.value=true then
if check1.value=1 and option4.value=true then
sql="查询语句1"
elseif check1.value=1 and option5.value=ture hen
sql="查询语句2"
elseif check1.value=1 and option6.value=ture hen
sql="查询语句3"
end if
elseif option2.value=true then
if check1.value=1 and option4.value=true then
sql="查询语句4"
elseif check1.value=1 and option5.value=ture hen
sql="查询语句5"
elseif check1.value=1 and option6.value=ture hen
sql="查询语句6"
end if
elseif option3.value=true then
if check1.value=1 and option4.value=true then
sql="查询语句7"
elseif check1.value=1 and option5.value=ture hen
sql="查询语句8"
elseif check1.value=1 and option6.value=ture hen
sql="查询语句9"
end if
同时:
Private Sub Form_Load()
Option4.Enabled = False
Option5.Enabled = False
Option6.Enabled = False
Combo5.Enabled = False
Combo6.Enabled = False
Combo7.Enabled = False
End Sub
Private Sub Check1_Click()
Option4.Enabled = Not Option4.Enabled
Option5.Enabled = Not Option5.Enabled
Option6.Enabled = Not Option6.Enabled
Combo5.Enabled = Not Combo5.Enabled
Combo6.Enabled = Not Combo6.Enabled
Combo7.Enabled = Not Combo7.Enabled
Combo8.Enabled = Not Combo8.Enabled
Combo8.Enabled = False
字段较多。
或改用ListView
又如何做?