📄 frmifind.frm
字号:
Left = 4560
TabIndex = 30
Top = 1320
Visible = 0 'False
Width = 900
End
Begin VB.Label lbltype
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品名称:"
Height = 180
Left = 1440
TabIndex = 29
Top = 1320
Visible = 0 'False
Width = 900
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 480
Index = 3
Left = 3480
Picture = "frmIFind.frx":4DA2
Top = 1440
Width = 480
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 480
Index = 2
Left = 3480
Picture = "frmIFind.frx":51E4
Top = 960
Width = 480
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 480
Index = 1
Left = 3480
Picture = "frmIFind.frx":5626
Top = 480
Width = 480
End
Begin VB.Image Image1
Appearance = 0 'Flat
Height = 480
Index = 0
Left = 3480
Picture = "frmIFind.frx":5A68
Top = 120
Width = 480
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "公司名称:"
Height = 180
Left = 480
TabIndex = 13
Top = 1560
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品名称:"
Height = 180
Left = 480
TabIndex = 12
Top = 1080
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "日 期:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 480
TabIndex = 11
Top = 600
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单据号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 480
TabIndex = 10
Top = 240
Width = 840
End
End
End
Attribute VB_Name = "frmIFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ck1_Click()
If ck1.Value Then
txtid.Enabled = True
txt1id.Enabled = True
txtid.SetFocus
Else
txtid.Enabled = False
txt1id.Enabled = False
' txtid = ""
' txt1id = ""
End If
End Sub
Private Sub ck2_Click()
If ck2.Value Then
dtp1.Enabled = True
dtp2.Enabled = True
Else
dtp1.Enabled = False
dtp2.Enabled = False
End If
End Sub
Private Sub ck3_Click()
If ck3.Value Then
cmdE1.Enabled = True
cmdE2.Enabled = True
cmdE1.SetFocus
Else
cmdE1.Enabled = False
cmdE2.Enabled = False
End If
End Sub
Private Sub ck4_Click()
If ck4.Value Then
txtcomp.Enabled = True
txtcomp1.Enabled = True
txtcomp.SetFocus
Else
txtcomp.Enabled = False
txtcomp1.Enabled = False
End If
End Sub
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub cmdcomp_Click()
frmcompany.CmdInsert.Visible = True
frmcompany.InsertType = "frmIFind"
frmcompany.Show 1
End Sub
Private Sub cmdcomp1_Click()
cmdcomp_Click
End Sub
Private Sub CmdDelete_Click()
txtid = "": txt1id = ""
txtele = "": txtele1 = ""
txtcomp = "": txtcomp1 = ""
End Sub
Private Sub cmdE1_Click()
If opt1.Value Then
frmelement.CmdInsert.Visible = True
frmelement.InsertType = "frmIFind"
frmelement.Show 1
Else
frmPinfo.CmdInsert.Visible = True
frmPinfo.InsertType = "frmIFind"
frmPinfo.Show 1
End If
End Sub
Private Sub cmdE2_Click()
cmdE1_Click
End Sub
Private Sub CmdOk_Click()
On Error GoTo gl
Dim Str As String
If opt1.Value Then
If frmIFind.Caption = "入 库 单" Then
Str = "select * from compdateF where ioflg=true "
Else 'If frmIFind.Caption = "出 库 单" Then
Str = "select * from compdateF where ioflg=false"
End If
Else
If frmIFind.Caption = "入 库 单" Then
Str = "select * from CompDateFP where ioflg=true"
Else
Str = "select * from CompDateFP where ioflg=false"
End If
End If
If ck1.Value And txt1id <> "" Then
If Val(txtid) > Val(txt1id) Then
MsgBox " 数据输入错误! ", vbInformation, ginfo
txt1id.SetFocus
Exit Sub
End If
Str = Str & " and id>= " & Val(txtid) & " and id<=" & Val(txt1id)
End If
If ck2.Value Then
If dtp1 < dtp2 Then
Str = Str & " and date >= # " & Format(dtp1, "yyyy-mm-dd") & " # and date<= # " & Format(dtp2, "yyyy-mm-dd") & " #"
Else
MsgBox " 前边日期大于后边的日期! ", , ginfo
Exit Sub
End If
End If
If opt1.Value Then
If ck3.Value Then
Str = Str & " and ename in ('" & txtele & " ','" & txtele1 & "')"
Str = Str & " and etype in ('" & lbltype & "','" & lbltype1 & "')"
End If
Else
If ck3.Value Then
Str = Str & " and pname in ('" & txtele & "','" & txtele1 & " ')"
End If
End If
If ck4.Value Then
Str = Str & " and memo in('" & txtcomp & " ','" & txtcomp1 & "')"
End If
If frmIFind.Caption <> "入库统计" Then
If RSF.State Then
RSF.Close
RSF.Open Str, cn, adOpenKeyset, adLockBatchOptimistic
Else
RSF.Open Str, cn, adOpenKeyset, adLockBatchOptimistic
End If
If opt1.Value Then
frmsee.dtgrd.Visible = True
Set frmsee.dtgrd.DataSource = RSF
Else
frmsee.dtgrd.Visible = False
Set frmsee.dtgrd1.DataSource = RSF
End If
frmsee.Show 1
Else
Set RSF = Nothing
RSF.CursorLocation = adUseClient
RSF.Open Str, cn, adOpenStatic, adLockBatchOptimistic
RSF.Requery
Set frmcount.dtgrd.DataSource = RSF
frmcount.Show
End If
Exit Sub
gl: MsgBox err.Description
End Sub
Private Sub Form_Load()
dtp2.Value = CDate(Now)
End Sub
Private Sub Form_Unload(Cancel As Integer)
If RSF.State Then
RSF.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -