【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-frmInquireCK2.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Begin VB.Form frmInquireCK2
BorderStyle = 3 'Fixed Dialog
Caption = "进货信息查询——按仓库"
ClientHeight = 2580
ClientLeft = 45
ClientTop = 330
ClientWidth = 5610
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2580
ScaleWidth = 5610
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CheckBox chkDate
Caption = "按时间:"
Height = 252
Left = 120
TabIndex = 19
Top = 720
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 288
Index = 0
Left = 1440
Style = 2 'Dropdown List
TabIndex = 10
Top = 120
Width = 3852
End
Begin VB.Frame Frame1
Height = 1212
Index = 0
Left = 1320
TabIndex = 4
Top = 600
Width = 3972
Begin VB.ComboBox cboDay
Height = 288
Index = 1
Left = 3048
Style = 2 'Dropdown List
TabIndex = 15
Top = 720
Width = 612
End
Begin VB.ComboBox cboMonth
Height = 288
Index = 1
Left = 2136
Style = 2 'Dropdown List
TabIndex = 14
Top = 720
Width = 645
End
Begin VB.ComboBox cboYear
Height = 288
Index = 1
Left = 960
Style = 2 'Dropdown List
TabIndex = 13
Top = 720
Width = 765
End
Begin VB.ComboBox cboDay
Height = 288
Index = 0
Left = 3000
Style = 2 'Dropdown List
TabIndex = 8
Top = 240
Width = 612
End
Begin VB.ComboBox cboMonth
Height = 288
Index = 0
Left = 2088
Style = 2 'Dropdown List
TabIndex = 1
Top = 240
Width = 645
End
Begin VB.ComboBox cboYear
Height = 288
Index = 0
Left = 912
Style = 2 'Dropdown List
TabIndex = 0
Top = 240
Width = 765
End
Begin VB.Label Label1
Caption = "日"
Height = 216
Index = 0
Left = 3720
TabIndex = 18
Top = 720
Width = 240
End
Begin VB.Label Label1
Caption = "年"
Height = 216
Index = 3
Left = 1800
TabIndex = 17
Top = 720
Width = 240
End
Begin
VB.Label Label1
Caption = "月"
Height = 216
Index = 4
Left = 2808
TabIndex = 16
Top = 720
Width = 240
End
Begin VB.Label lblitem
Caption = "终止时间:"
Height = 252
Index = 3
Left = 240
TabIndex = 12
Top = 720
Width = 1092
End
Begin VB.Label lblitem
Caption = "起始时间:"
Height = 252
Index = 1
Left = 240
TabIndex = 11
Top = 240
Width = 1092
End
Begin VB.Label Label1
Caption = "日"
Height = 216
Index = 7
Left = 3720
TabIndex = 7
Top = 240
Width = 240
End
Begin VB.Label Label1
Caption = "年"
Height = 216
Index = 1
Left = 1752
TabIndex = 6
Top = 240
Width = 240
End
Begin VB.Label Label1
Caption = "月"
Height = 216
Index = 2
Left = 2760
TabIndex = 5
Top = 240
Width = 240
End
End
Begin VB.CommandButton cmdOk
Caption = "确定 (&O)"
Default = -1 'True
Height = 375
Left = 1680
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.CommandButton cmdExit
Caption = "取消 (&X)"
Height = 375
Left = 3120
TabIndex = 3
Top = 2040
Width = 1215
End
Begin VB.Label lblitem
Caption = "仓库名称:"
Height = 255
Index = 2
Left = 240
TabIndex = 9
Top = 120
Width = 975
End
End
Attribute VB_Name = "frmInquireCK2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'用于传递
查询块
Private Sub chkItem_Click(Index As Integer)
If Index = 2 Then
cboYear(0).SetFocus
Else
txtItem(Index).SetFocus
End If
End Sub
Private Sub cmdExit_Click()
Me.Hide
End Sub
Private Sub cmdOK_Click()
Dim dBeginDate As String
Dim dEndDate As String
Dim sQSql As String
sQSql = "select inh.in_date,inh.inh_no,dm_ck.dm,dm_ck.mc,dm_wz.dm,dm_wz.mc,inh.qihao,inh.sl,inh.in_danj,inh.i_zk,inh.i_zke,inh.ywman,dm_gf.dm,dm_gf.mc,inh.jsfk,inh.jz,inh.yf,inh.bz from inh inner join dm_gf on inh.gfdm = dm_gf.dm inner join dm_ck on inh.ckdm = dm_ck.dm inner join dm_wz on inh.wzdm = dm_wz.dm where dm_ck.mc = '" & Trim(Combo1(0)) & "'"
If chkDate.Value = vbChecked Then
dBeginDate = Format(CDate(cboYear(0) & "-" & cboMonth(0) & "-" & cboDay(0)), "yyyy-mm-dd")
dEndDate = Format(CDate(cboYear(1) & "-" & cboMonth(1) & "-" & cboDay(1)), "yyyy-mm-dd")
sQSql = sQSql & " and inh.in_date >= '" & dBeginDate & " '"
sQSql = sQSql & " and inh.in_date <= '" & dEndDate & " '"
frmInquireCK.reportSQL = "{dm_ck.mc} = '" & Trim(Combo1(0)) & "' and {inh.in_date} in #" & dBeginDate & "# to # " & dEndDate & "#"
Else
frmInquireCK.reportSQL = "{dm_ck.mc} = '" & Trim(Combo1(0)) & "'"
End If
If Trim(sQSql) = "" Then
MsgBox "请设置查询条件!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
frmInquireCK.txtSQL = sQSql
Me.Hide
frmInquireCK.Show 0
End If
End Sub
Private Sub Form_Load()
Dim i As Integer
Dim j As Integer
Dim sSQL As String
Dim txtSQL As String
Dim MsgText As String
Dim mrc As ADODB.Recordset
txtSQL = "select di