📄 form35.frm
字号:
VERSION 5.00
Begin VB.Form Form35
Caption = "Form35"
ClientHeight = 5475
ClientLeft = 60
ClientTop = 345
ClientWidth = 6570
LinkTopic = "Form35"
ScaleHeight = 5475
ScaleWidth = 6570
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "确认输入"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 13
Top = 4680
Width = 1935
End
Begin VB.TextBox Text6
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 11
Top = 3960
Width = 1815
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 9
Top = 3360
Width = 1815
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 7
Top = 2760
Width = 1815
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 5
Top = 2160
Width = 1815
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 3
Top = 1560
Width = 1815
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 1
Top = 960
Width = 1815
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "资产输入画面"
BeginProperty Font
Name = "黑体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2400
TabIndex = 12
Top = 480
Width = 1890
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "折旧年数:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1560
TabIndex = 10
Top = 4080
Width = 1290
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "购置金额:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1560
TabIndex = 8
Top = 3480
Width = 1290
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "购置日期:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1560
TabIndex = 6
Top = 2880
Width = 1290
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "购置月份:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1560
TabIndex = 4
Top = 2280
Width = 1290
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "购置年份:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1560
TabIndex = 2
Top = 1680
Width = 1290
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "资产名称:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1560
TabIndex = 0
Top = 1080
Width = 1290
End
End
Attribute VB_Name = "Form35"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text5.Text = "" Or Text5.Text = 0 Then
MsgBox ("金额不能为零")
Text5.SetFocus
GoSub exit_command1_click
End If
Dim cnn1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Set cnn1 = New ADODB.Connection
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\jujumao\My Documents\粤丰饲料\粤丰饲料经营情况.mdb;"
Set cmd1 = New ADODB.Command
SQL = "SELECT count(*) from 资产项目表 where 资产名称=" & "'" & Text1.Text & "'"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
End With
Set rs1 = cmd1.Execute
rs1.MoveFirst
If rs1.Fields(0) > 0 Then
MsgBox ("该资产项目已经输入!")
cnn1.Close
Set cnn1 = Nothing
GoTo exit_command1_click
End If
SQL = "INSERT INTO 资产项目表(资产名称, 购置年份,购置月份,购置日期," & _
"购置金额,折旧年数) VALUES ( " & " '" & Text1.Text & "'" & "," & Text2.Text & "," & _
Text3.Text & "," & Text4.Text & "," & Text5.Text & "," & Text6.Text & ")"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
.Execute
End With
cnn1.Close
Set cnn1 = Nothing
MsgBox ("数据保存成功")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
exit_command1_click:
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form2.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -