📄 frmgetoutquery.frm
字号:
TabIndex = 30
Top = 720
Width = 855
End
Begin VB.Label Label16
Caption = "经手人:"
Height = 255
Left = 240
TabIndex = 29
Top = 1080
Width = 735
End
Begin VB.Label Label17
Caption = "操作员:"
Height = 255
Left = 2760
TabIndex = 28
Top = 1080
Width = 735
End
End
Begin VB.Frame Frame1
Caption = "出库信息查询条件"
Height = 1335
Left = 0
TabIndex = 0
Top = 0
Width = 7695
Begin VB.TextBox txtGoodName
Height = 270
Left = 1080
TabIndex = 9
Top = 240
Width = 1575
End
Begin VB.ComboBox CB_GoodClass
Height = 300
Left = 3960
TabIndex = 8
Top = 150
Width = 1335
End
Begin VB.ComboBox CB_StartYear
Height = 300
Left = 1080
TabIndex = 7
Top = 720
Width = 735
End
Begin VB.ComboBox CB_StartMonth
Height = 300
Left = 2040
TabIndex = 6
Top = 720
Width = 615
End
Begin VB.ComboBox CB_StartDay
Height = 300
Left = 2880
TabIndex = 5
Top = 720
Width = 615
End
Begin VB.ComboBox CB_EndYear
Height = 300
Left = 4800
TabIndex = 4
Top = 720
Width = 855
End
Begin VB.ComboBox CB_EndMonth
Height = 300
Left = 5880
TabIndex = 3
Top = 720
Width = 615
End
Begin VB.ComboBox CB_EndDay
Height = 300
Left = 6720
TabIndex = 2
Top = 720
Width = 615
End
Begin VB.CommandButton Command1
Caption = "查询"
Height = 375
Left = 6120
TabIndex = 1
Top = 150
Width = 1095
End
Begin VB.Label Label1
Caption = "商品名称:"
Height = 375
Left = 120
TabIndex = 19
Top = 240
Width = 975
End
Begin VB.Label Label2
Caption = "商品类别:"
Height = 375
Left = 3000
TabIndex = 18
Top = 240
Width = 975
End
Begin VB.Label Label3
Caption = "开始时间:"
Height = 255
Left = 120
TabIndex = 17
Top = 720
Width = 975
End
Begin VB.Label Label4
Caption = "年"
Height = 255
Left = 1850
TabIndex = 16
Top = 720
Width = 375
End
Begin VB.Label Label5
Caption = "月"
Height = 255
Left = 2640
TabIndex = 15
Top = 720
Width = 375
End
Begin VB.Label Label6
Caption = "日"
Height = 375
Left = 3480
TabIndex = 14
Top = 720
Width = 375
End
Begin VB.Label Label7
Caption = "结束时间:"
Height = 375
Left = 3840
TabIndex = 13
Top = 720
Width = 1095
End
Begin VB.Label Label8
Caption = "年"
Height = 255
Left = 5640
TabIndex = 12
Top = 720
Width = 255
End
Begin VB.Label Label9
Caption = "月"
Height = 255
Left = 6480
TabIndex = 11
Top = 720
Width = 375
End
Begin VB.Label Label10
Caption = "日"
Height = 255
Left = 7320
TabIndex = 10
Top = 720
Width = 255
End
End
End
Attribute VB_Name = "FrmGetOutQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
'Download by http://www.codefans.net
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sql As String
Dim startTime As String '开始时间
Dim endTime As String '结束时间
startTime = Me.CB_StartYear.Text & "-" & Me.CB_StartMonth.Text & "-" & Me.CB_StartDay.Text
endTime = Me.CB_EndYear.Text & "-" & Me.CB_EndMonth.Text & "-" & Me.CB_EndDay.Text
sql = "select goodName as 商品名称,goodClassName as 商品类别,goodAmount as 出库数量,outTime as 出库时间,reason as 出库原因,person as 经手人,operator as 操作员"
sql = sql & " from getOutInfo where outTime >= '" & startTime & "' and outTime <= '" & endTime & "'"
If Me.txtGoodName.Text <> "" Then
sql = sql & " and goodName like '%" & Me.txtGoodName.Text & "%'"
End If
If Me.CB_GoodClass.Text <> "" Then
sql = sql & " and goodClassName = '" & Me.CB_GoodClass.Text & "'"
End If
Me.Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data\goodStock.mdb;Persist Security Info=False"
Me.Adodc1.CommandType = adCmdText
Me.Adodc1.RecordSource = sql
Me.Adodc1.Refresh
End Sub
Private Sub Form_Load()
Dim goodClassRs As ADODB.Recordset
Dim sql As String
Dim i As Integer
Call check_condatabase
sql = "select goodClassName from goodClass"
Set goodClassRs = cn.Execute(sql)
While Not goodClassRs.EOF
Me.CB_GoodClass.AddItem goodClassRs("goodClassName")
goodClassRs.MoveNext
Wend
Me.CB_StartYear.Text = CStr(Year(Date))
Me.CB_EndYear.Text = CStr(Year(Date))
If Month(Date) = 1 Then
Me.CB_StartMonth.Text = "12"
Me.CB_StartYear.Text = CStr(Year(Date) - 1)
Else
Me.CB_StartMonth.Text = CStr(Month(Date) - 1)
End If
Me.CB_EndMonth.Text = CStr(Month(Date))
Me.CB_StartDay.Text = CStr(Day(Date))
Me.CB_EndDay.Text = CStr(Day(Date))
For i = 2000 To 2100
Me.CB_StartYear.AddItem CStr(i)
Me.CB_EndYear.AddItem CStr(i)
Next i
For i = 1 To 12
Me.CB_StartMonth.AddItem CStr(i)
Me.CB_EndMonth.AddItem CStr(i)
Next i
For i = 1 To 31
Me.CB_StartDay.AddItem CStr(i)
Me.CB_EndDay.AddItem CStr(i)
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -