仓库查询系统的管理软件的源代码
源代码在线查看: 出库信息查询.frm
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form 出库信息查询
BorderStyle = 1 'Fixed Single
Caption = "出库信息查询"
ClientHeight = 8070
ClientLeft = 45
ClientTop = 435
ClientWidth = 9165
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 8070
ScaleWidth = 9165
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCheck
Caption = "确 定"
Default = -1 'True
Height = 450
Left = 1200
TabIndex = 5
Top = 960
Width = 1200
End
Begin VB.CommandButton cmdClear
Caption = "取 消"
Height = 450
Left = 3480
TabIndex = 4
Top = 960
Width = 1200
End
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 450
Left = 5760
TabIndex = 3
Top = 960
Width = 1200
End
Begin VB.TextBox txt1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
TabIndex = 1
Top = 240
Width = 1695
End
Begin VB.TextBox txt2
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 5520
TabIndex = 0
Top = 240
Width = 1695
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 5895
Left = 480
TabIndex = 2
Top = 1680
Width = 8295
_ExtentX = 14631
_ExtentY = 10398
_Version = 393216
Cols = 7
AllowUserResizing= 1
FormatString = "^ 货物编号 |^ 货物名称 |^ 出库数量 |^ 出库时间 |^ 出库人 |^ 仓管员 |^ 备 注 "
End
Begin VB.Label Label1
Caption = "按名称查询:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 840
TabIndex = 7
Top = 360
Width = 1335
End
Begin VB.Label Label2
Caption = "按编号查询:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4200
TabIndex = 6
Top = 360
Width = 1455
End
End
Attribute VB_Name = "出库信息查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCheck_Click()
Dim rst As New ADODB.Recordset
Dim strCheck As String
Dim strSQL As String
Dim strItem As String
On Error GoTo ErrorExit
Me.MSFlexGrid1.Rows = 1
If Me.txt1.Text "" Then
strCheck = " 名称 LIKE '" & Me.txt1.Text & "'"
End If
If Me.txt2.Text "" Then
strCheck = " 编号 LIKE '" & Me.txt2.Text & "'"
End If
strSQL = "select * from 出库"
If strCheck "" Then
strSQL = strSQL & " WHERE " & strCheck
End If
rst.Open strSQL, cnnDatabase, adOpenStatic, adLockReadOnly
If rst.RecordCount = 0 Then
MsgBox "数据库中无相关入库记录!", vbInformation, "请注意"
Exit Sub
Else
rst.MoveFirst
Do Until rst.EOF
strItem = rst!编号 & Chr(9) & rst!名称 & Chr(9) & rst!出库数量 & Chr(9) & _
Format(rst!出库时间, "yyyy年m月d日") & Chr(9) & _
rst!出库人 & Chr(9) & rst!仓管员 & Chr(9) & rst!备注
Me.MSFlexGrid1.AddItem strItem
Me.MSFlexGrid1.ColWidth(2) = 1500
Module1.MSFBackColor Me.MSFlexGrid1, Me.MSFlexGrid1.Rows - 1
rst.MoveNext
Loop
End If
Set rst = Nothing
Exit Sub
ErrorExit:
MsgBox Err.Description, vbInformation, Me.Caption
Set rst = Nothing
End Sub
Private Sub cmdClear_Click()
Initial
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub Initial()
Me.txt1 = ""
Me.txt2 = ""
Me.MSFlexGrid1.Rows = 1
End Sub