| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 858 人关注过本帖
标题:Option控件和文本框的运用
只看楼主 加入收藏
jxawgyl
Rank: 1
等 级:新手上路
帖 子:208
专家分:0
注 册:2007-10-16
结帖率:100%
收藏
 问题点数:0 回复次数:3 
Option控件和文本框的运用
我用两个控件option1与iption2,一个文本框,当选择option1时,
文本框等于:"select * from dbo.Medicine where spell like'" _
      & Text1.Text & "%" & "'"
选择option2时,
文本框等于:"select * from dbo.Medicine where fivepen like'" _
      & Text1.Text & "%" & "'"

我是这样写的:If Option1.Value = True Then
              text1.text = med

先申明     Dim med As String
med = "select medname,medspec,fivepen,spell from dbo.Medicine where spell like'" _
      & Text1.Text & "%" & "'"

运行不行,请各位指教。
搜索更多相关主题的帖子: 文本框 Option 控件 spell Medicine 
2008-06-12 08:57
makebest
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:3
帖 子:658
专家分:962
注 册:2005-3-17
收藏
得分:0 
还不如把代码贴上来, 被你越说越糊涂了!
2008-06-12 09:19
jxawgyl
Rank: 1
等 级:新手上路
帖 子:208
专家分:0
注 册:2007-10-16
收藏
得分:0 
是这样的,
Dim med As String
 '如果没有选择部分信息,则退出
  If Text1.Text = "" Then
    Exit Sub
  End If
med = "select * from Medicine where fivepen like'" _
      & Text1.Text & "%" & "'"
      With Adodc2
      .RecordSource = med
      .Refresh
      End With
      If modify = False Then
      End If
End Sub

option1(为spell),option2(为fivepen),当我选择option1时,
上面的med查询条件为
where spell like'" _
      & Text1.Text & "%" & "'"
反之则为 where fivepen like'" _
      & Text1.Text & "%" & "'"
不知我说清了吗?
2008-06-12 09:53
jxawgyl
Rank: 1
等 级:新手上路
帖 子:208
专家分:0
注 册:2007-10-16
收藏
得分:0 
没有人回答,我顶一下,希望有人能帮个忙。
2008-06-25 08:47
快速回复:Option控件和文本框的运用
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014015 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved