mdsk.net
当前位置:首页 >> vB 在文本框中输入数值,点击查询,在下面几个文本... >>

vB 在文本框中输入数值,点击查询,在下面几个文本...

Private Sub Command1_Click() With Adodc1 .RecordSource = "select * from [你的表名] where [学号]='" & Text1.Text & "'" .Refresh Text2.Text = .Recordset("[学号]") Text3.Text = IIf(IsNull(.Recordset(["姓名"])), "没有姓名", .Record...

Private Sub Command1_Click() If Text1 = "" Then Exit Sub For i = 1 To Len(Text2) If Mid(Text2, i, Len(Text1)) = Text1 Then Text2.SelStart = i - 1 Text2.SelLength = Len(Text1) Text2.SetFocus Exit For End If NextEnd Sub 上面的是t...

先判断文本框是否有内容 if Trim(Text1.text)="" then msgbox "请输入查询内容!" exit sub End if 再判断查询结果是否为空 If Adodc1.Recordset.EOF Then 改成: If Adodc1.Recordset.EOF or Adodc1.Recordset.BOF Then

Private Sub Command1_Click() Dim sz As Integer, zm As Integer For I = 1 To Len(Text1.Text) Select Case Mid(Text1.Text, I, 1) Case "A" To "Z", "a" To "z" zm = zm + 1 Case "0" To "9" sz = sz + 1 End Select Next I Text2.Text = "字...

select * from 表名 where 地址 Like '%哈尔滨%'

PasswordChar 属性 返回或设置一个值,该值指示所键入的字符或占位符在 TextBox 控件中是否要显示出来;返回或设置用作占位符。 语法 object.PasswordChar [= value] PasswordChar 属性的语法包含下面部分: 部分 描述 Object 对象表达式,其值...

查询结果可以绑定datagrid或mshflexgrid或msflexgrid等控件来显示结果。 sql="select * from table where xx=" & trim(text1) rs.open sql 。。。 set datagrid1.datasource=rs

Private Sub Command1_Click() If Text1.Text = "" Then MsgBox "请输入成绩", vbInformation, "提示" Text1.SetFocus Exit Sub End If If IsNumeric(Text1.Text) = False Then MsgBox "你输入的不是数字,请重新输入", vbInformation, "提示" T...

执行查询,然后将查询结果绑到datagrid就OK了 Rs.CursorLocation = adUseClientRs.Open "select 寝室号 from table1 where 寝室号 like '02-%'", Conn, adOpenStatic, adLockBatchOptimisticset datagrid1.DataSource=Rs有结果就会直接显示到dat...

Private Sub Command1_Click() For i = 0 To Combo1.ListCount - 1 If Mid(Combo1.List(i), 1, 3) = Text1.Text Then Label2.Caption = "姓 名 英语 数学 VB" + vbCrLf + Combo1.List(i) Exit For End If If i = Combo1.ListCount - 1 Then Labe...

网站首页 | 网站地图
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com