frmsearchid.frm
来自「需要控件:Active Report 2.0(专业报表控件破解版)2.0下的ar」· FRM 代码 · 共 435 行
FRM
435 行
VERSION 5.00
Begin VB.Form FrmSearchID
BorderStyle = 1 'Fixed Single
Caption = "按产品编号查询维修记录"
ClientHeight = 4635
ClientLeft = 45
ClientTop = 330
ClientWidth = 6540
Icon = "FrmSearchID.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4635
ScaleWidth = 6540
StartUpPosition = 2 '屏幕中心
Begin ServicingMS.ucReportList List1
Height = 1665
Left = 90
TabIndex = 27
Top = 2910
Width = 2745
_ExtentX = 4842
_ExtentY = 2937
BeginProperty FontHeader {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
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
End
Begin VB.Frame Frame1
Height = 1230
Left = 2925
TabIndex = 0
Top = 3345
Width = 3525
Begin VB.TextBox Text1
Height = 270
Left = 1635
MaxLength = 10
TabIndex = 1
Text = "0103017822"
ToolTipText = "产品编号必须为10位数字."
Top = 270
Width = 1695
End
Begin ServicingMS.lvButtons_H CmdSearch
Height = 420
Left = 2085
TabIndex = 3
Top = 690
Width = 1245
_ExtentX = 2196
_ExtentY = 741
Caption = "确认查询"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = "FrmSearchID.frx":038A
cBack = -2147483633
End
Begin ServicingMS.lvButtons_H CmdPrint
Height = 405
Left = 405
TabIndex = 4
Top = 705
Width = 1185
_ExtentX = 2090
_ExtentY = 714
Caption = "打印输出"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = "FrmSearchID.frx":0724
Enabled = 0 'False
cBack = -2147483633
End
Begin VB.Label Label1
Caption = "请输入产品编号:"
Height = 225
Left = 225
TabIndex = 2
Top = 345
Width = 1425
End
End
Begin VB.Image Image1
Height = 240
Left = 3210
Picture = "FrmSearchID.frx":0A78
Top = 2880
Width = 240
End
Begin VB.Label Label14
Caption = "提示:请输入10位产品编号,按回车或单击[确认查询]按钮进行查询."
Height = 420
Left = 3600
TabIndex = 26
Top = 2925
Width = 2850
End
Begin VB.Label Label7
Caption = "产品资料 "
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 1
Left = 105
TabIndex = 25
Top = 60
Width = 2865
End
Begin VB.Label Label13
Caption = "维修部件清单:"
Height = 240
Left = 150
TabIndex = 24
Top = 2370
Width = 1410
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 8
Left = 3855
TabIndex = 23
Top = 2445
Width = 2520
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 7
Left = 1155
TabIndex = 22
Top = 1980
Width = 1530
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 6
Left = 3855
TabIndex = 21
Top = 1995
Width = 2520
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 5
Left = 3855
TabIndex = 20
Top = 1500
Width = 2520
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 4
Left = 1170
TabIndex = 19
Top = 1500
Width = 1530
End
Begin VB.Label Label12
Caption = "处理方式:"
Height = 240
Left = 2835
TabIndex = 18
Top = 2505
Width = 960
End
Begin VB.Label Label11
Caption = "维修结果:"
Height = 240
Left = 150
TabIndex = 17
Top = 2010
Width = 960
End
Begin VB.Label Label10
Caption = "损坏原因:"
Height = 240
Left = 2850
TabIndex = 16
Top = 2010
Width = 960
End
Begin VB.Label Label9
Caption = "修好时间:"
Height = 240
Left = 2850
TabIndex = 15
Top = 1560
Width = 960
End
Begin VB.Label Label8
Caption = "维修时间:"
Height = 255
Left = 150
TabIndex = 14
Top = 1560
Width = 960
End
Begin VB.Label Label7
Caption = "维修情况 "
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 0
Left = 90
TabIndex = 13
Top = 1230
Width = 2865
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 3
Left = 3855
TabIndex = 12
Top = 825
Width = 2520
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 2
Left = 1200
TabIndex = 11
Top = 825
Width = 1500
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 1
Left = 3855
TabIndex = 10
Top = 345
Width = 2520
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Height = 300
Index = 0
Left = 1185
TabIndex = 9
Top = 345
Width = 1530
End
Begin VB.Label Label5
Caption = "客户名称:"
Height = 240
Left = 2820
TabIndex = 8
Top = 885
Width = 930
End
Begin VB.Label Label4
Caption = "生产日期:"
Height = 240
Left = 150
TabIndex = 7
Top = 885
Width = 960
End
Begin VB.Label Label3
Caption = "规格:"
Height = 240
Left = 2895
TabIndex = 6
Top = 420
Width = 960
End
Begin VB.Label Label2
Caption = "型号:"
Height = 240
Left = 150
TabIndex = 5
Top = 420
Width = 960
End
End
Attribute VB_Name = "FrmSearchID"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub CmdPrint_Click()
If Len(Text1) <> 10 Then
MsgBox "产品编号必须为10位数字.", vbCritical, "提示"
Exit Sub
End If
PrintSearchID.Show vbModal
End Sub
Private Sub CmdSearch_Click()
Call Text1_KeyPress(13)
End Sub
Private Sub Form_Load()
Cn.Open "dsn=SerManage"
Set rs = New ADODB.Recordset
List1.AddHeader 100, LeftJustify, "维修零件名称"
List1.AddHeader 50, RightJustify, "数量"
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
rs.Close
Cn.Close
End Sub
Private Sub Text1_Change()
If Len(Trim(Text1)) <> 0 Then
CmdPrint.Enabled = True
Else
CmdPrint.Enabled = False
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Len(Text1.Text) = 0 Then
MsgBox "请输入要查询的产品编号.", vbInformation, "提示"
Exit Sub
End If
With rs
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "select * from Product where ProductID='" & Text1.Text & "'"
.ActiveConnection = Cn
.Open
End With
Dim i As Integer
If rs.RecordCount <> 0 Then
Label6(0) = rs.Fields(2)
Label6(1) = rs.Fields(3)
Label6(2) = rs.Fields(5)
Label6(3) = rs.Fields(4)
Label6(4) = rs.Fields(6)
Label6(5) = rs.Fields(7)
Label6(7) = rs.Fields(8)
Label6(6) = rs.Fields(10)
Label6(8) = rs.Fields(9)
rs.Close
With rs
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "select * from PartsList where ProductID='" & Text1.Text & "'"
.ActiveConnection = Cn
.Open
End With
List1.ClearList
For i = 0 To rs.RecordCount - 1
List1.AddItem rs.Fields(1) & vbTab & rs.Fields(2)
rs.MoveNext
Next
CmdPrint.Enabled = True
Else
MsgBox "无次编号的产品登录,请检查输入的编号。", vbCritical, "提示"
CmdPrint.Enabled = False
Exit Sub
End If
rs.Close
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?