📄 frmsearchdayjh.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmSearchDayJH
Caption = "进货信息查询"
ClientHeight = 6720
ClientLeft = 60
ClientTop = 345
ClientWidth = 9015
LinkTopic = "Form1"
ScaleHeight = 6720
ScaleWidth = 9015
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin VB.Frame Frame1
Caption = "查询条件"
Height = 1095
Left = 120
TabIndex = 2
Top = 120
Width = 8775
Begin VB.CommandButton Command1
Caption = "分类汇总"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5280
TabIndex = 7
Top = 360
Width = 1215
End
Begin VB.CommandButton cmdSearch
Caption = "查询"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3720
TabIndex = 5
Top = 360
Width = 1335
End
Begin VB.CommandButton cmdClose
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6720
TabIndex = 4
Top = 360
Width = 1335
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 255
Left = 1800
TabIndex = 3
Top = 480
Width = 1575
_ExtentX = 2778
_ExtentY = 450
_Version = 393216
Format = 184680449
CurrentDate = 38686
End
Begin VB.Label Label1
Caption = "日期:"
Height = 255
Left = 720
TabIndex = 6
Top = 480
Width = 735
End
End
Begin VB.Frame Frame2
Caption = "查询结果"
Height = 5295
Left = 120
TabIndex = 0
Top = 1320
Width = 8775
Begin MSAdodcLib.Adodc adoSearchJH
Height = 375
Left = 960
Top = 1200
Visible = 0 'False
Width = 2535
_ExtentX = 4471
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "adosearchJH"
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 MSDataGridLib.DataGrid DataGrid1
Bindings = "frmSearchDayJH.frx":0000
Height = 4935
Left = 120
TabIndex = 1
Top = 240
Width = 8535
_ExtentX = 15055
_ExtentY = 8705
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
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
End
Attribute VB_Name = "frmSearchDayJH"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdSearch_Click()
Dim MyDate As Date
Dim sql As String
Dim startdate As String
Dim enddate As String
startdate = Year(DTPicker1.Value) & "/" & Month(DTPicker1.Value) & "/" & Day(DTPicker1.Value) & " 00:00:01"
enddate = Year(DTPicker1.Value) & "/" & Month(DTPicker1.Value) & "/" & Day(DTPicker1.Value) & " 23:59:59"
sqlFindJH = "select 进货表.进货编号,商品表.商品名称,进货表.结账方式,"
sqlFindJH = sqlFindJH & "进货表.单价,进货表.数量,进货表.总额,进货表.日期,进货表.备注 "
sqlFindJH = sqlFindJH & "from 进货表,商品表 "
sqlFindJH = sqlFindJH & "where 进货表.商品编号=商品表.商品编号 and 进货表.日期 Between #" & startdate & "# And #" & enddate & "#"
sqlFindJH = sqlFindJH & " order by 进货表.ID"
adoSearchJH.ConnectionString = ConnStr
adoSearchJH.CommandType = adCmdText
adoSearchJH.RecordSource = sqlFindJH
adoSearchJH.Refresh
If adoSearchJH.Recordset.EOF Then
MsgBox "没有查询到相关记录,请重试!", vbInformation + vbOKOnly, "系统提示"
Exit Sub
End If
adoSearchJH.Refresh
End Sub
Private Sub Command1_Click()
Dim MyDate As Date
Dim sql As String
Dim startdate As String
Dim enddate As String
startdate = Year(DTPicker1.Value) & "/" & Month(DTPicker1.Value) & "/" & Day(DTPicker1.Value) & " 00:00:01"
enddate = Year(DTPicker1.Value) & "/" & Month(DTPicker1.Value) & "/" & Day(DTPicker1.Value) & " 23:59:59"
sqlFindJH = "select 进货表.商品编号,商品表.商品名称,sum(进货表.数量) as 进货数量,sum(进货表.总额) as 进货总额 from 进货表,商品表 "
sqlFindJH = sqlFindJH & "where 进货表.商品编号=商品表.商品编号 and 进货表.日期 Between #" & startdate & "# And #" & enddate & "#"
sqlFindJH = sqlFindJH & " group by 进货表.商品编号,商品表.商品名称"
adoSearchJH.ConnectionString = ConnStr
adoSearchJH.CommandType = adCmdText
adoSearchJH.RecordSource = sqlFindJH
adoSearchJH.Refresh
If adoSearchJH.Recordset.EOF Then
MsgBox "没有查询到相关记录,请重试!", vbInformation + vbOKOnly, "系统提示"
Exit Sub
End If
adoSearchJH.Refresh
End Sub
Private Sub Form_Load()
DTPicker1.Value = Now()
End Sub
Private Sub Form_Resize()
Frame1.Width = Me.Width - 2 * 240
Frame1.Left = 240
Frame2.Width = Me.Width - 2 * 240
Frame2.Left = 240
If (Me.Height - 1560 - 600) < 0 Then
Frame2.Height = 400
Else
Frame2.Height = Me.Height - 1560 - 600
End If
DataGrid1.Width = Frame2.Width - 200
DataGrid1.Height = Frame2.Height - 400
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set frmSearchDayJH = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -