📄 frmgetinquery.frm
字号:
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
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Frame Frame1
Caption = "入库信息查询条件"
Height = 1335
Left = 120
TabIndex = 0
Top = 120
Width = 7695
Begin VB.CommandButton Command1
Caption = "查询"
Height = 375
Left = 6120
TabIndex = 20
Top = 150
Width = 1095
End
Begin VB.ComboBox CB_EndDay
Height = 300
Left = 6720
TabIndex = 18
Top = 720
Width = 615
End
Begin VB.ComboBox CB_EndMonth
Height = 300
Left = 5880
TabIndex = 16
Top = 720
Width = 615
End
Begin VB.ComboBox CB_EndYear
Height = 300
Left = 4800
TabIndex = 14
Top = 720
Width = 855
End
Begin VB.ComboBox CB_StartDay
Height = 300
Left = 2880
TabIndex = 11
Top = 720
Width = 615
End
Begin VB.ComboBox CB_StartMonth
Height = 300
Left = 2040
TabIndex = 9
Top = 720
Width = 615
End
Begin VB.ComboBox CB_StartYear
Height = 300
Left = 1080
TabIndex = 7
Top = 720
Width = 735
End
Begin VB.ComboBox CB_GoodClass
Height = 300
Left = 3960
TabIndex = 5
Top = 150
Width = 1335
End
Begin VB.TextBox txtGoodName
Height = 270
Left = 1080
TabIndex = 3
Top = 240
Width = 1575
End
Begin VB.Label Label10
Caption = "日"
Height = 255
Left = 7320
TabIndex = 19
Top = 720
Width = 255
End
Begin VB.Label Label9
Caption = "月"
Height = 255
Left = 6480
TabIndex = 17
Top = 720
Width = 375
End
Begin VB.Label Label8
Caption = "年"
Height = 255
Left = 5640
TabIndex = 15
Top = 720
Width = 255
End
Begin VB.Label Label7
Caption = "结束时间:"
Height = 375
Left = 3840
TabIndex = 13
Top = 720
Width = 1095
End
Begin VB.Label Label6
Caption = "日"
Height = 375
Left = 3480
TabIndex = 12
Top = 720
Width = 375
End
Begin VB.Label Label5
Caption = "月"
Height = 255
Left = 2640
TabIndex = 10
Top = 720
Width = 375
End
Begin VB.Label Label4
Caption = "年"
Height = 255
Left = 1850
TabIndex = 8
Top = 720
Width = 375
End
Begin VB.Label Label3
Caption = "开始时间:"
Height = 255
Left = 120
TabIndex = 6
Top = 720
Width = 975
End
Begin VB.Label Label2
Caption = "商品类别:"
Height = 375
Left = 3000
TabIndex = 4
Top = 240
Width = 975
End
Begin VB.Label Label1
Caption = "商品名称:"
Height = 375
Left = 120
TabIndex = 2
Top = 240
Width = 975
End
End
End
Attribute VB_Name = "FrmGetInQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
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 入库数量,inTime as 入库时间,reason as 入库原因,person as 经手人,operator as 操作员"
sql = sql & " from getInInfo where inTime >= '" & startTime & "' and inTime <= '" & 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
'Download by http://www.codefans.net
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -