📄 form7.frm
字号:
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 = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc4
Height = 375
Left = 120
Top = 720
Visible = 0 'False
Width = 1560
_ExtentX = 2752
_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 = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc5
Height = 375
Left = 120
Top = 1440
Visible = 0 'False
Width = 1560
_ExtentX = 2752
_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 = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "至"
ForeColor = &H000000FF&
Height = 375
Left = 5040
TabIndex = 24
Top = 2835
Width = 375
End
Begin VB.Label Label6
Caption = "时间格式:2006年1月1日输入 20060101,其余类似。"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 855
Left = 7800
TabIndex = 16
Top = 2520
Width = 3255
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "供货商家"
Height = 375
Left = 1440
TabIndex = 14
Top = 1920
Width = 1575
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "进货时间"
Height = 375
Left = 1440
TabIndex = 11
Top = 2760
Width = 1575
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "颜 色"
Height = 375
Left = 7680
TabIndex = 9
Top = 1080
Width = 1575
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "规 格"
Height = 375
Left = 1440
TabIndex = 6
Top = 1080
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "货物名称"
Height = 375
Left = 1440
TabIndex = 3
Top = 240
Width = 1575
End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc2.RecordSource = "select gg from jhmx where jtxhbs='1'and gg<>''and gg<>'*'group by gg"
Adodc2.Refresh
Set DataGrid3.DataSource = Adodc2
Set Text2.DataSource = Adodc2
Text2.DataField = "gg"
DataGrid3.Visible = True
End Sub
Private Sub Command2_Click()
Adodc3.RecordSource = "select ys from jhmx where jtxhbs='1'and ys<>''and ys<>'*' group by ys"
Adodc3.Refresh
Set DataGrid4.DataSource = Adodc3
Set Text3.DataSource = Adodc3
Text3.DataField = "ys"
DataGrid4.Visible = True
End Sub
Private Sub Command3_Click()
Adodc4.RecordSource = "select cj from jhmx where jtxhbs='1'and cj<>''and cj<>'*' group by cj"
Adodc4.Refresh
Set DataGrid5.DataSource = Adodc4
Set Text5.DataSource = Adodc4
Text5.DataField = "cj"
DataGrid5.Visible = True
End Sub
Private Sub Command4_Click()
Dim A As String
A = Text1 + "%"
Adodc1.RecordSource = "select cpmc from jhmx where cpmc<>'' and JTXHBS='1'and cpmc like'" & A & "'group by cpmc"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set Text1.DataSource = Adodc1
Text1.DataField = "cpmc"
DataGrid1.Visible = True
End Sub
Private Sub Command5_Click()
If Len(Text4) <> 0 And Len(Text4) < 4 Or Len(Text4) = 5 Or Len(Text4) = 7 Then
MsgBox "时间输入错误,请核实!", vbExclamation, "系统提示您"
GoTo 10
End If
Dim B As String
Dim c As String
Dim D As String
Dim E As Date
Dim F As String
B = "%" + Text1 + "%"
c = "%" + Text2 + "%"
D = "%" + Text3 + "%"
F = "%" + Text5 + "%"
If Text4 = "" Then
Text6 = "%"
End If
If Text4 = "" And Text7 = "" Then
Adodc5.RecordSource = "select cpmc,gg,sl,ys,cj,jhsj,bz,cbj from jhmx where cpmc like'" & B & "'and gg like'" & c & "' and ys like'" & D & "'and cj like'" & F & "' and JTXHBS='1' group by cpmc,gg,sl,ys,cj,jhsj,bz,cbj order by jhsj "
Adodc5.Refresh
End If
If Text4 = "" And Text7 <> "" Then
Adodc5.RecordSource = "select cpmc,gg,sl,ys,cj,jhsj,bz,cbj from jhmx where cpmc like'" & B & "'and gg like'" & c & "' and ys like'" & D & "'and cj like'" & F & "' and JTXHBS='1' and jhsj<='" & Text7 & "'group by cpmc,gg,sl,ys,cj,jhsj,bz,cbj order by jhsj "
Adodc5.Refresh
End If
If Text4 <> "" And Text7 = "" Then
Adodc5.RecordSource = "select cpmc,gg,sl,ys,cj,jhsj,bz,cbj from jhmx where cpmc like'" & B & "'and gg like'" & c & "' and ys like'" & D & "'and cj like'" & F & "' and JTXHBS='1' and jhsj>='" & Text4 & "'group by cpmc,gg,sl,ys,cj,jhsj,bz,cbj order by jhsj "
Adodc5.Refresh
End If
If Text4 <> "" And Text7 <> "" Then
Adodc5.RecordSource = "select cpmc,gg,sl,ys,cj,jhsj,bz,cbj from jhmx where cpmc like'" & B & "'and gg like'" & c & "' and ys like'" & D & "'and cj like'" & F & "' and JTXHBS='1' and jhsj between '" & Text4 & "'and '" & Text7 & "'group by cpmc,gg,sl,ys,cj,jhsj,bz,cbj order by jhsj "
Adodc5.Refresh
End If
If Adodc5.Recordset.BOF = True And Adodc5.Recordset.EOF = True Then
MsgBox "没有你要查找的进货记录,请核实!", vbExclamation, "系统提示您"
GoTo 10
End If
Set DataGrid2.DataSource = Adodc5
10 End Sub
Private Sub Command6_Click()
Unload Form7
End Sub
Private Sub DataGrid1_Click()
DataGrid1.Visible = False
End Sub
Private Sub DataGrid1_LostFocus()
DataGrid1.Visible = False
End Sub
Private Sub DataGrid3_Click()
DataGrid3.Visible = False
End Sub
Private Sub DataGrid3_LostFocus()
DataGrid3.Visible = False
End Sub
Private Sub DataGrid4_Click()
DataGrid4.Visible = False
End Sub
Private Sub DataGrid4_LostFocus()
DataGrid4.Visible = False
End Sub
Private Sub DataGrid5_Click()
DataGrid5.Visible = False
End Sub
Private Sub DataGrid5_LostFocus()
DataGrid5.Visible = False
End Sub
Private Sub Form_Click()
DataGrid1.Visible = False
DataGrid3.Visible = False
DataGrid4.Visible = False
DataGrid5.Visible = False
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc2.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc3.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc4.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc5.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
End Sub
Private Sub Text1_Change()
DataGrid1.Visible = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim A As String
A = Text1 + "%"
Adodc1.RecordSource = "select cpmc from jhmx where cpmc<>'' and JTXHBS='1'and cpmc like'" & A & "'group by cpmc"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set Text1.DataSource = Adodc1
Text1.DataField = "cpmc"
DataGrid1.Visible = True
End If
End Sub
Private Sub Text2_Click()
DataGrid3.Visible = False
End Sub
Private Sub Text3_Click()
DataGrid4.Visible = False
End Sub
Private Sub Text5_Click()
DataGrid5.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -