麻烦帮小弟我看下代码,多谢

麻烦帮我看下代码,谢谢温度条件IftemCheck.ValueThenwhere_temand适用温度(最大) &temText2.Text&an

麻烦帮我看下代码,谢谢
'温度条件
        If   temCheck.Value   Then
                where_tem   =   "and   适用温度(最大)   <= "   &   temText2.Text   &   "   and   适用温度(最小)   > =   "   &   temText3.Text   &   " "
        Else
                where_tem   =   " "
        End   If
        '压力条件
        If   preCheck.Value   Then
                where_pre   =   "and   公称压力(最大)   <= "   &   preText2.Text   &   "   and   公称压力(最小)   > = "   &   preText3.Text   &   " "
        Else
                where_pre   =   " "
        End   If
        '流量条件
        If   flowCheck.Value   Then
                where_flow   =   "and   流量上限 <= "   &   flowText2.Text   &   "   and   流量下限> = "   &   flowText3.Text   &   " "
        Else
                where_flow   =   " "
        End   If
      '介质条件
        If   medCheck.Value   Then
                where_media   =   "and   适用介质= ' "   &   medDataCombo.Text   &   " ' "
        Else
                where_media   =   " "
        End   If
        '构造sql查询语句
        strsql   =   "select   *   from   安全阀   where   1=1   "   &   where_tem   &   where_pre   &   where_flow   &   where_media
        queryAdodc.RecordSource   =   strsql
        queryAdodc.Refresh
        queryDataGrid.Refresh
为什么会出现   表达式中 '适用温度 '   '公称压力 '函数未定义?
麻烦大家给看看,谢谢了!!!


[解决办法]
你可以改為[适用温度(最大)],既加個中括號
[解决办法]
检查方法,在strsql设置断点,然后解析出来看看

我觉得
where_tem = " and 适用温度(最大) <= " & temText2.Text & " and 适用温度(最小) > = " & temText3.Text & " "

也就是在and前面加上空格,其他变量也如此