📄 main_rcyw_rkcx.frm
字号:
EndProperty
BeginProperty Column14
ColumnWidth = 1154.835
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Height = 630
Left = 45
TabIndex = 0
Top = -15
Width = 5385
Begin VB.CheckBox Check1
Height = 225
Left = 135
TabIndex = 20
Top = 240
Width = 270
End
Begin MSComCtl2.DTPicker DTP1
Height = 285
Left = 1035
TabIndex = 12
Top = 240
Width = 1860
_ExtentX = 3281
_ExtentY = 503
_Version = 393216
Format = 30015489
CurrentDate = 37855
End
Begin MSComCtl2.DTPicker DTP2
Height = 285
Left = 3360
TabIndex = 14
Top = 240
Width = 1860
_ExtentX = 3281
_ExtentY = 503
_Version = 393216
Format = 30015489
CurrentDate = 37855
End
Begin VB.Label Label2
Caption = "日期从 至"
Height = 180
Left = 435
TabIndex = 13
Top = 300
Width = 2910
End
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = -735
Top = 2565
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=NBooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "NBooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from rkb"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = -360
Top = 2910
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=NBooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "NBooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from rkb"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame4
Height = 660
Left = 45
TabIndex = 15
Top = 495
Width = 5385
Begin VB.CheckBox Check2
Height = 225
Left = 135
TabIndex = 19
Top = 255
Width = 270
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "main_rcyw_rkcx.frx":0457
Left = 1950
List = "main_rcyw_rkcx.frx":0459
TabIndex = 18
Top = 210
Width = 780
End
Begin VB.ComboBox Combo1
Height = 300
Left = 435
TabIndex = 17
Top = 210
Width = 1515
End
Begin VB.TextBox Text1
Height = 300
Left = 2730
TabIndex = 16
Top = 210
Width = 2505
End
End
Begin VB.Label je
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 180
Left = 4920
TabIndex = 6
Top = 3660
Width = 1755
End
Begin VB.Label sl
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 180
Left = 2655
TabIndex = 5
Top = 3660
Width = 1080
End
Begin VB.Label pz
BackStyle = 0 'Transparent
ForeColor = &H0000FF00&
Height = 180
Left = 945
TabIndex = 4
Top = 3675
Width = 780
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "入库品种: 入库数量: 入库金额:"
Height = 195
Left = 60
TabIndex = 3
Top = 3660
Width = 6765
End
End
Attribute VB_Name = "main_rcyw_rkcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Myval As String
Private Sub viewdata() '声明显示入库品种、入库数量、入库金额的过程
With Adodc2.Recordset
If .Fields(0) <> "" Then pz.Caption = .Fields(0) Else pz.Caption = "0"
If .Fields(1) <> "" Then sl.Caption = .Fields(1) Else sl.Caption = "0"
If .Fields(2) <> "" Then je.Caption = Format(.Fields(2), "0.00") Else je.Caption = "0.00"
End With
End Sub
Private Sub Form_Load()
'添加字段列表
Combo1.AddItem ("书号")
Combo1.AddItem ("条形码")
Combo1.AddItem ("书名")
Combo1.AddItem ("作者")
Combo1.AddItem ("出版社")
Combo1.AddItem ("版次")
Combo1.AddItem ("图书类别")
Combo1.AddItem ("存放位置")
Combo1.AddItem ("票号")
Combo1.AddItem ("操作员")
Combo1.AddItem ("经手人")
Combo1.ListIndex = 0
'添加查询条件列表
Combo2.AddItem ("like")
Combo2.AddItem ("=")
Combo2.ListIndex = 0
'设置查询日期
DTP1.Value = Date - 10
DTP2.Value = Date
CmdFind_Click
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub CmdFind_Click()
Select Case Combo2.text
Case Is = "like"
If Check1.Value = 0 And Check2.Value = 1 Then
Adodc1.RecordSource = "select * from rkb where rkb." + Combo1.text + " like +'" + Text1.text + "'+ '%'order by 票号"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as 品种,sum(入库数量)as 合计数量,sum(金额)as 合计金额 from rkb where rkb." + Combo1.text + " like +'" + Text1.text + "'+ '%'"
Adodc2.Refresh
Call viewdata
End If
If Check1.Value = 1 And Check2.Value = 0 Then
Adodc1.RecordSource = "Select * from rkb where 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + "order by 票号"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as 品种,sum(入库数量)as 合计数量,sum(金额)as 合计金额 from rkb where 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + ""
Adodc2.Refresh
Call viewdata
End If
If Check1.Value = 1 And Check2.Value = 1 Then
Adodc1.RecordSource = "select * from rkb where rkb." & Combo1.text & " " & " like +'" + Text1.text + "'+ '%'and 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + "order by 票号"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as 品种,sum(入库数量)as 合计数量,sum(金额)as 合计金额 from rkb where rkb." & Combo1.text & " " & "like +'" + Text1.text + "'+ '%'and 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + ""
Adodc2.Refresh
Call viewdata
End If
Case Is = "="
If Check1.Value = 0 And Check2.Value = 1 Then
Adodc1.RecordSource = "select * from rkb where rkb." & Combo1.text & " " & "= '" + Text1.text + "'order by 票号"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as 品种,sum(入库数量)as 合计数量,sum(金额)as 合计金额 from rkb where rkb." & Combo1.text & " " & "='" + Text1.text + "'"
Adodc2.Refresh
Call viewdata
End If
If Check1.Value = 1 And Check2.Value = 1 Then
Adodc1.RecordSource = "select * from rkb where rkb." & Combo1.text & " " & " ='" + Text1.text + "'and 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + "order by 票号"
Adodc1.Refresh
Adodc2.RecordSource = "select count(*)as 品种,sum(入库数量)as 合计数量,sum(金额)as 合计金额 from rkb where rkb." & Combo1.text & " " & "='" + Text1.text + "'and 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + ""
Adodc2.Refresh
Call viewdata
End If
End Select
End Sub
Private Sub CmdPrint_Click()
Select Case Combo2.text
Case Is = "like"
If Check1.Value = 0 And Check2.Value = 1 Then
DataE1.rsCommand2.Open "select * from rkb where rkb." + Combo1.text + " like +'" + Text1.text + "'+ '%'order by 票号", Cnn, adOpenKeyset, adLockOptimistic
End If
If Check1.Value = 1 And Check2.Value = 0 Then
DataE1.rsCommand2.Open "Select * from rkb where 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + "order by 票号", Cnn, adOpenKeyset, adLockOptimistic
End If
If Check1.Value = 1 And Check2.Value = 1 Then
DataE1.rsCommand2.Open "select * from rkb where rkb." & Combo1.text & " " & " like +'" + Text1.text + "'+ '%'and 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + "order by 票号", Cnn, adOpenKeyset, adLockOptimistic
End If
Case Is = "="
If Check1.Value = 0 And Check2.Value = 1 Then
DataE1.rsCommand2.Open "select * from rkb where rkb." & Combo1.text & " " & "= '" + Text1.text + "'order by 票号"
End If
If Check1.Value = 1 And Check2.Value = 1 Then
DataE1.rsCommand2.Open "select * from rkb where rkb." & Combo1.text & " " & " ='" + Text1.text + "'and 日期 between " + Chr(35) + Str(DTP1.Value) + Chr(35) + "and " + Chr(35) + Str(DTP2.Value) + Chr(35) + "order by 票号", Cnn, adOpenKeyset, adLockOptimistic
End If
End Select
DR1_tsrkcx.Show
End Sub
Private Sub CmdDelete_Click()
Myval = MsgBox("是否真的删除该数据?", vbYesNo)
If Myval = vbYes Then
On Error Resume Next
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
End If
End Sub
Private Sub CmdEnd_Click()
Unload Me
frm_main.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -