📄 form6.frm
字号:
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 = 0
Top = 0
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 = 1320
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 Label8
Caption = $"Form6.frx":0000
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 2295
Left = 360
TabIndex = 0
Top = 8520
Width = 5895
End
End
Attribute VB_Name = "Form6"
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 gg<>''and gg<>'*' group by gg"
Adodc2.Refresh
Set DataGrid2.DataSource = Adodc2
Set Text12.DataSource = Adodc2
Text12.DataField = "gg"
DataGrid2.Visible = True
End Sub
Private Sub Command2_Click()
Adodc3.RecordSource = "select cj from jhmx where cj<>''and cj<>'*' group by cj"
Adodc3.Refresh
Set DataGrid3.DataSource = Adodc3
Set Text13.DataSource = Adodc3
Text13.DataField = "cj"
DataGrid3.Visible = True
End Sub
Private Sub Command3_Click()
Adodc4.RecordSource = "select ys from jhmx where ys<>''and ys<> '*' group by ys"
Adodc4.Refresh
Set DataGrid4.DataSource = Adodc4
Set Text14.DataSource = Adodc4
Text14.DataField = "ys"
DataGrid4.Visible = True
End Sub
Private Sub Command4_Click()
Adodc1.RecordSource = "select cpmc from jhmx where cpmc like'" & Text11.Text & "' and cpmc<>''group by cpmc"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set Text10.DataSource = Adodc1
Text10.DataField = "cpmc"
DataGrid1.Visible = True
End Sub
Private Sub Command5_Click()
If Text2 = "" Then
Text2 = "*"
End If
If Text4 = "" Then
Text4 = "*"
End If
If Text5 = "" Then
Text5 = "*"
End If
If Text1 = "" Then
MsgBox "请选择或输入货物名称!", vbExclamation, "系统提示您"
GoTo 1
End If
If Text3 = "" Then
MsgBox "请输入进货数量!", vbExclamation, "系统提示您"
GoTo 1
End If
If Text6 = "" Then
MsgBox "请输入成本价!", vbExclamation, "系统提示您"
GoTo 1
End If
Text8 = Date + Time
Text9 = "1"
Adodc5.Recordset.Update
Adodc5.Refresh
Adodc5.Recordset.AddNew
Text10 = ""
Text12 = ""
Text13 = ""
Text14 = ""
1 End Sub
Private Sub Command6_Click()
Unload Form6
End Sub
Private Sub DataGrid1_Click()
DataGrid1.Visible = False
End Sub
Private Sub DataGrid1_LostFocus()
DataGrid1.Visible = False
End Sub
Private Sub DataGrid2_Click()
DataGrid2.Visible = False
End Sub
Private Sub DataGrid2_LostFocus()
DataGrid2.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 Form_Click()
DataGrid1.Visible = False
DataGrid2.Visible = False
DataGrid3.Visible = False
DataGrid4.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 & ""
Adodc5.RecordSource = "select * from jhmx "
Adodc5.Refresh
Set Text1.DataSource = Adodc5
Text1.DataField = "cpmc"
Set Text2.DataSource = Adodc5
Text2.DataField = "gg"
Set Text3.DataSource = Adodc5
Text3.DataField = "sl"
Set Text4.DataSource = Adodc5
Text4.DataField = "cj"
Set Text5.DataSource = Adodc5
Text5.DataField = "ys"
Set Text6.DataSource = Adodc5
Text6.DataField = "cbj"
Set Text7.DataSource = Adodc5
Text7.DataField = "bz"
Set Text8.DataSource = Adodc5
Text8.DataField = "jhsj"
Set Text9.DataSource = Adodc5
Text9.DataField = "JTXHBS"
Adodc5.Recordset.AddNew
End Sub
Private Sub Frame1_Click()
DataGrid1.Visible = False
DataGrid2.Visible = False
DataGrid3.Visible = False
DataGrid4.Visible = False
End Sub
Private Sub Text1_Change()
Text11 = Text1 + "%"
End Sub
Private Sub Text1_Click()
DataGrid1.Visible = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.RecordSource = "select cpmc from jhmx where cpmc like'" & Text11.Text & "' and cpmc<>''group by cpmc"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set Text10.DataSource = Adodc1
Text10.DataField = "cpmc"
DataGrid1.Visible = True
End If
End Sub
Private Sub Text10_Change()
Text1 = Trim(Text10)
End Sub
Private Sub Text12_Change()
Text2 = Text12
End Sub
Private Sub Text13_Change()
Text4 = Text13
End Sub
Private Sub Text14_Change()
Text5 = Text14
End Sub
Private Sub Text2_Click()
DataGrid2.Visible = False
End Sub
Private Sub Text4_Click()
DataGrid3.Visible = False
End Sub
Private Sub Text5_Click()
DataGrid4.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -