📄 frmlinkman5.frm
字号:
VERSION 5.00
Begin VB.Form frmLinkman5
BorderStyle = 1 'Fixed Single
Caption = "查询联系人信息"
ClientHeight = 2340
ClientLeft = 30
ClientTop = 330
ClientWidth = 3855
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2340
ScaleWidth = 3855
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "显示所有(&A)"
Height = 375
Left = 1320
TabIndex = 11
Top = 1800
Width = 1215
End
Begin VB.TextBox txtItem
Height = 270
Index = 0
Left = 1440
TabIndex = 7
Top = 120
Width = 2172
End
Begin VB.CommandButton cmdExit
Caption = "取消 (&X)"
Height = 375
Left = 2160
TabIndex = 6
Top = 1200
Width = 1215
End
Begin VB.CommandButton cmdOk
Caption = "确定 (&O)"
Default = -1 'True
Height = 375
Left = 600
TabIndex = 5
Top = 1200
Width = 1215
End
Begin VB.CheckBox chkItem
Caption = "Check1"
Height = 180
Index = 0
Left = 120
TabIndex = 4
TabStop = 0 'False
Top = 120
Value = 1 'Checked
Width = 132
End
Begin VB.ComboBox Combo1
Height = 288
Left = 1440
Style = 2 'Dropdown List
TabIndex = 3
Top = 840
Visible = 0 'False
Width = 2172
End
Begin VB.CheckBox chkItem
Caption = "Check1"
Height = 180
Index = 1
Left = 120
TabIndex = 2
TabStop = 0 'False
Top = 480
Width = 132
End
Begin VB.CheckBox chkItem
Caption = "Check1"
Height = 180
Index = 2
Left = 120
TabIndex = 1
TabStop = 0 'False
Top = 840
Visible = 0 'False
Width = 132
End
Begin VB.TextBox txtItem
Height = 270
Index = 1
Left = 1440
TabIndex = 0
Top = 480
Width = 2172
End
Begin VB.Label lblitem
Caption = "名字:"
Height = 252
Index = 0
Left = 480
TabIndex = 10
Top = 120
Width = 1092
End
Begin VB.Label lblitem
Caption = "所在城市:"
Height = 252
Index = 1
Left = 480
TabIndex = 9
Top = 840
Visible = 0 'False
Width = 1092
End
Begin VB.Label lblitem
Caption = "姓氏:"
Height = 252
Index = 2
Left = 480
TabIndex = 8
Top = 480
Width = 1092
End
End
Attribute VB_Name = "frmLinkman5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub chkItem_Click(Index As Integer)
If Index = 0 Then
txtItem(0).SetFocus
ElseIf Index = 1 Then
txtItem(1).SetFocus
Else
Combo1.SetFocus
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim sQSql As String
If chkItem(0).Value = vbChecked Then
sQSql = " 名字 = '" & Trim(txtItem(0) & " ") & "'"
End If
If chkItem(1).Value = vbChecked Then
If Trim(sQSql & " ") = "" Then
sQSql = " 姓氏 ='" & Trim(txtItem(1) & " ") & "'"
Else
sQSql = sQSql & " and 姓氏 ='" & Trim(txtItem(1) & " ") & "'"
End If
End If
If chkItem(2).Value = vbChecked Then
If Trim(sQSql & " ") = "" Then
sQSql = " City ='" & Trim(Combo1 & " ") & "'"
Else
sQSql = sQSql & " and City ='" & Trim(Combo1 & " ") & "'"
End If
End If
If Trim(sQSql) = "" Then
MsgBox "请设置查询条件!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
If flagAedit Then
Unload frmLinkman3
End If
frmLinkman3.txtsql = "select * from 工厂联系人 where" & sQSql
frmLinkman3.Show
End If
Unload Me
End Sub
Private Sub Command1_Click()
frmLinkman3.txtsql = "select * from 工厂联系人"
frmLinkman3.Show
Unload Me
End Sub
Private Sub Form_Load()
Dim I As Integer
Dim j As Integer
Dim sSql As String
Dim txtsql As String
Dim Msgtext As String
Dim mrc As ADODB.Recordset
Combo1.Clear
txtsql = "select DISTINCT City from suppliers"
Set mrc = ExecuteSQL(txtsql, Msgtext)
If Not mrc.EOF Then
Do While Not mrc.EOF
Combo1.AddItem Trim(mrc.Fields(0))
mrc.MoveNext
Loop
Else
MsgBox "请先进行供应商设置!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
mrc.Close
End Sub
Private Sub lblitem_Click(Index As Integer)
chkItem(Index).Value = vbChecked
End Sub
Private Sub txtItem_GotFocus(Index As Integer)
txtItem(Index).SelStart = 0
txtItem(Index).SelLength = Len(txtItem(Index))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -