📄 查询会员信息.frm
字号:
VERSION 5.00
Begin VB.Form form3
Caption = "Form1"
ClientHeight = 3555
ClientLeft = 60
ClientTop = 390
ClientWidth = 5880
LinkTopic = "Form1"
ScaleHeight = 3555
ScaleWidth = 5880
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3240
TabIndex = 4
Top = 2640
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1800
TabIndex = 3
Top = 2640
Width = 975
End
Begin VB.Frame Frame1
Caption = "会员查询"
Height = 2055
Left = 720
TabIndex = 0
Top = 240
Width = 3855
Begin VB.TextBox Text1
Height = 495
Left = 840
TabIndex = 2
Top = 240
Width = 2535
End
Begin VB.Label Label1
Caption = "会员号"
Height = 495
Left = 240
TabIndex = 1
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim note As New ADODB.Recordset
Private Sub Command1_Click()
Dim sql As String
sql = "select * from 会员表 where 会员号='" & Trim(Text1.Text) & "'"
note.Open sql, cnn, 3, 2
If note.EOF And note.BOF Then
MsgBox "查找失败!!会员不存在!"
note.Close
Text1.Text = ""
Else
form5.Show
On Error Resume Next '有错误也强制执行
note.MoveFirst
If Err.Number <> 0 Then Exit Sub '如果有错则退出
Do While Not note.EOF '循环直到记录集的末尾
form5.MSFlexGrid1.AddItem (Empty) '将记录集合的数据输出到MSFLEXGRID控件
form5.MSFlexGrid1.Row = form5.MSFlexGrid1.Rows - 2
form5.MSFlexGrid1.Col = 0
form5.MSFlexGrid1.Text = Trim(note.Fields("会员号").Value)
form5.MSFlexGrid1.Col = 1
form5.MSFlexGrid1.Text = Trim(note.Fields("姓名").Value)
form5.MSFlexGrid1.Col = 2
form5.MSFlexGrid1.Text = note.Fields("电话").Value
form5.MSFlexGrid1.Col = 3
form5.MSFlexGrid1.Text = Trim(note.Fields("余额").Value)
form5.MSFlexGrid1.Col = 4
form5.MSFlexGrid1.Text = note.Fields("购书总额").Value
note.MoveNext
Loop
Set note = Nothing '释放连接
form5.MSFlexGrid1.RemoveItem form5.MSFlexGrid1.Rows - 1
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -