?? form41.frm
字號:
VERSION 5.00
Begin VB.Form Form41
BorderStyle = 3 'Fixed Dialog
Caption = "Form41"
ClientHeight = 3195
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
LinkTopic = "Form41"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
ShowInTaskbar = 0 'False
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 = 1440
TabIndex = 3
Top = 2160
Width = 1695
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 = 2040
TabIndex = 0
Top = 1200
Width = 1900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "費用名稱:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 840
TabIndex = 2
Top = 1320
Width = 1200
End
Begin VB.Label Label4
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 = 840
TabIndex = 1
Top = 480
Width = 3150
End
End
Attribute VB_Name = "Form41"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox ("沒有輸入數據不能保存")
Text1.SetFocus
GoSub exit_command1_click
End If
Dim cnn1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim rs1 As ADODB.Recordset
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) = 1 Then
MsgBox ("該項目已輸入")
cnn1.Close
Set cnn1 = Nothing
Text1.Text = ""
Text1.SetFocus
GoSub exit_command1_click
End If
SQL = "INSERT INTO 跟單費用項目表(費用名稱) VALUES ( '" & Text1.Text & "'" & ")"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
.Execute
End With
MsgBox ("數據保存成功")
Text1.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 + -