?? frminquirezz2.frm
字號:
VERSION 5.00
Begin VB.Form frmInquireZZ2
BorderStyle = 3 'Fixed Dialog
Caption = "組裝信息查詢——分類明細(xì)"
ClientHeight = 2310
ClientLeft = 45
ClientTop = 330
ClientWidth = 5880
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2310
ScaleWidth = 5880
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CheckBox chkDate
Caption = "按時間:"
Height = 252
Left = 240
TabIndex = 19
Top = 480
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
Index = 0
Left = 1320
Style = 2 'Dropdown List
TabIndex = 10
Top = 120
Width = 4215
End
Begin VB.Frame Frame1
Height = 1212
Index = 0
Left = 1320
TabIndex = 4
Top = 480
Width = 4215
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 = 300
Index = 0
Left = 990
Style = 2 'Dropdown List
TabIndex = 0
Top = 240
Width = 690
End
Begin VB.Label Label1
Caption = "日"
Height = 210
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 = 255
Index = 3
Left = 120
TabIndex = 12
Top = 720
Width = 1095
End
Begin VB.Label lblitem
Caption = "起始時間:"
Height = 255
Index = 1
Left = 120
TabIndex = 11
Top = 240
Width = 1095
End
Begin VB.Label Label1
Caption = "日"
Height = 210
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 = 1800
Width = 1215
End
Begin VB.CommandButton cmdExit
Caption = "取消 (&X)"
Height = 375
Left = 3120
TabIndex = 3
Top = 1800
Width = 1215
End
Begin VB.Label lblitem
Caption = "產(chǎn)品名稱:"
Height = 255
Index = 2
Left = 240
TabIndex = 9
Top = 120
Width = 975
End
End
Attribute VB_Name = "frmInquireZZ2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'用于傳遞查詢塊
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.sl,inh.in_danj,inh.i_zk,inh.i_zke,inh.ywman,inh.jsfk,inh.jz,inh.yf,inh.bz from inh inner join dm_ck on inh.ckdm = dm_ck.dm inner join dm_wz on inh.wzdm = dm_wz.dm where inh.bz1 = '組裝' and dm_wz.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 zc.zc_date >= '" & dBeginDate & " '"
sQSql = sQSql & " and zc.zc_date <= '" & dEndDate & " '"
End If
If Trim(sQSql) = "" Then
MsgBox "請設(shè)置查詢條件!", vbOKOnly + vbExclamation, "警告"
Exit Sub
Else
frmInquireZZ.txtSQL = sQSql
Me.Hide
frmInquireZZ.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 distinct dm_wz.mc from inh inner join dm_wz on inh.wzdm = dm_wz.dm where inh.bz1= '組裝'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If Not mrc.EOF Then
With mrc
Do While Not .EOF
Combo1(0).AddItem .Fields(0)
.MoveNext
Loop
End With
Combo1(0).ListIndex = 0
Else
cmdOK.Enabled = False
End If
mrc.Close
txtSQL = "select distinct datepart(yy,in_date) from inh where bz1 = '組裝'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF = False Then
With mrc
Do While Not .EOF
cboYear(0).AddItem .Fields(0)
cboYear(1).AddItem .Fields(0)
.MoveNext
Loop
End With
cboYear(0).ListIndex = 0
cboYear(1).ListIndex = 0
For j = 1 To 12
cboMonth(0).AddItem j
cboMonth(1).AddItem j
Next j
cboMonth(0).Text = Month(Now())
cboMonth(1).Text = Month(Now())
For j = 1 To 31
cboDay(0).AddItem j
cboDay(1).AddItem j
Next j
cboDay(0).Text = Day(Now())
cboDay(1).Text = Day(Now())
Else
cmdOK.Enabled = False
End If
mrc.Close
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -