📄 查看客户.frm
字号:
Top = 765
Width = 1695
End
Begin VB.TextBox Tbianhao
Appearance = 0 'Flat
Height = 270
Left = 4080
TabIndex = 1
Top = 285
Width = 1695
End
Begin VB.OptionButton 按姓名查找
Caption = "按姓名查找"
Height = 375
Left = 1440
Style = 1 'Graphical
TabIndex = 8
Top = 720
Width = 1215
End
Begin VB.OptionButton 按编号查找
Caption = "按编号查找"
Height = 375
Left = 1440
Style = 1 'Graphical
TabIndex = 7
Top = 240
Value = -1 'True
Width = 1215
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "提示:本查询支持模糊查询"
ForeColor = &H00FF0000&
Height = 180
Left = 3000
TabIndex = 30
Top = 1200
Width = 2160
End
Begin VB.Image Image1
Height = 735
Left = 240
Picture = "查看客户.frx":058A
Top = 360
Width = 795
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "请输入姓名:"
Height = 180
Left = 3000
TabIndex = 10
Top = 810
Width = 990
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入编号:"
Height = 180
Left = 3000
TabIndex = 9
Top = 330
Width = 990
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "查看客户.frx":151B
Height = 2595
Left = 120
TabIndex = 5
Top = 240
Width = 9495
_ExtentX = 16748
_ExtentY = 4577
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 14
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "客 户 概 况"
ColumnCount = 5
BeginProperty Column00
DataField = "buyer_id"
Caption = " 客户编号"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "buyer_name"
Caption = " 客 户 姓 名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column02
DataField = "buyer_company"
Caption = " 客 户 单 位"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column03
DataField = "buyer_tel"
Caption = " 客 户 电 话"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column04
DataField = "buyer_Email"
Caption = " 电 子 邮 箱"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 1214.929
EndProperty
BeginProperty Column01
EndProperty
BeginProperty Column02
ColumnWidth = 2564.788
EndProperty
BeginProperty Column03
EndProperty
BeginProperty Column04
ColumnWidth = 1980.284
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmFindKeHu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub a_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If a.Recordset.RecordCount = 0 Then
第0条 = "无记录"
共0条.Visible = False
Else
共0条.Visible = True
第0条 = "第" & a.Recordset.AbsolutePosition & "条"
共0条 = "共" & a.Recordset.RecordCount & "条"
End If
End Sub
'
'Private Sub a_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'If a.Recordset.RecordCount = 0 Then
' 第0条 = "无记录"
' 共0条.Visible = False
'Else
' 共0条.Visible = True
' 第0条 = "第" & a.Recordset.AbsolutePosition & "条"
' 共0条 = "共" & a.Recordset.RecordCount & "条"
'End If
'End Sub
Private Sub Form_Load()
frmFindKeHu.Left = 1000
frmFindKeHu.Top = 66
frmFindKeHu.Height = 6600
frmFindKeHu.Width = 10125
Txingming.Enabled = False
End Sub
Private Sub 按编号查找_Click()
Tbianhao.Enabled = True
Txingming.Enabled = False
Tbianhao.SetFocus
End Sub
Private Sub 按姓名查找_Click()
Txingming.Enabled = True
Tbianhao.Enabled = False
Txingming.SetFocus
End Sub
Private Sub 查找确定_Click()
If 按编号查找.Value = True Then
If Tbianhao = "" Then
MsgBox "请输入要查找的客户编号", vbInformation, "输入有误"
Exit Sub
End If
If IsNumeric(Tbianhao) = False Then
MsgBox "请输入数字", vbInformation, "输入有误"
Exit Sub
Else
a.RecordSource = "select * from kehu where buyer_id=" & Trim(Tbianhao)
End If
Else
If Txingming = "" Then
MsgBox "请输入所要查找的客户姓名", vbInformation, "出错提示"
Exit Sub
End If
a.RecordSource = "select * from kehu where buyer_name like '%" & Trim(Txingming) & "%'"
End If
a.Refresh
End Sub
Private Sub 第一条_Click()
If a.Recordset.RecordCount = 0 Then Exit Sub
a.Recordset.MoveFirst
End Sub
Private Sub 取消查找_Click()
a.RecordSource = "select * from kehu"
a.Refresh
Tbianhao = ""
Txingming = ""
End Sub
Private Sub 上一条_Click()
'If a.Recordset.BOF Then
' a.Recordset.MoveFirst
'Else
' a.Recordset.MovePrevious
'End If
If a.Recordset.RecordCount = 0 Then Exit Sub
If a.Recordset.AbsolutePosition = 1 Then
a.Recordset.MoveFirst
Else
a.Recordset.MovePrevious
End If
End Sub
Private Sub 退出_Click()
Unload Me
End Sub
Private Sub 下一条_Click()
'If a.Recordset.EOF Then
' a.Recordset.MoveLast
'Else
' a.Recordset.MoveNext
'End If
If a.Recordset.RecordCount = 0 Then Exit Sub
If a.Recordset.AbsolutePosition = a.Recordset.RecordCount Then
a.Recordset.MoveLast
Else
a.Recordset.MoveNext
End If
End Sub
Private Sub 最后一条_Click()
If a.Recordset.RecordCount = 0 Then Exit Sub
a.Recordset.MoveLast
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -