?? frm_im_add.frm
字號:
VERSION 5.00
Begin VB.Form frm_im_add
Caption = "添加入庫信息"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 450
ClientWidth = 5415
LinkTopic = "Form1"
ScaleHeight = 3435
ScaleWidth = 5415
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton fault
Caption = "取消"
Height = 375
Left = 3240
TabIndex = 20
Top = 2880
Width = 1215
End
Begin VB.CommandButton Cmd_OK
Caption = "確定"
Height = 375
Left = 1080
TabIndex = 19
Top = 2880
Width = 1215
End
Begin VB.Frame frameMain
Height = 2535
Left = 240
TabIndex = 0
Top = 120
Width = 4935
Begin VB.TextBox Checker
Height = 285
Left = 3720
TabIndex = 18
Top = 1440
Width = 975
End
Begin VB.TextBox Buyer
Height = 285
Left = 3720
TabIndex = 16
Top = 1080
Width = 975
End
Begin VB.TextBox Prodplace
Height = 285
Left = 3720
TabIndex = 14
Top = 720
Width = 975
End
Begin VB.TextBox Prodcom
Height = 285
Left = 3720
TabIndex = 12
Top = 360
Width = 975
End
Begin VB.TextBox Import_num
Height = 285
Left = 1320
TabIndex = 10
Top = 1080
Width = 975
End
Begin VB.TextBox Import_price
Height = 285
Left = 1320
TabIndex = 8
Top = 1440
Width = 975
End
Begin VB.TextBox Import_time
Height = 285
Left = 1320
TabIndex = 6
Top = 1800
Width = 975
End
Begin VB.TextBox Import_type
Height = 285
Left = 1320
TabIndex = 4
Top = 720
Width = 975
End
Begin VB.TextBox Import_name
Height = 285
Left = 1320
TabIndex = 2
Top = 360
Width = 975
End
Begin VB.Label Label9
Caption = "驗收員"
Height = 255
Left = 2520
TabIndex = 17
Top = 1440
Width = 1095
End
Begin VB.Label Label8
Caption = "采購員"
Height = 255
Left = 2520
TabIndex = 15
Top = 1080
Width = 1095
End
Begin VB.Label Label7
Caption = "產地"
Height = 255
Left = 2520
TabIndex = 13
Top = 720
Width = 1095
End
Begin VB.Label Label6
Caption = "生產廠家"
Height = 255
Left = 2520
TabIndex = 11
Top = 360
Width = 1095
End
Begin VB.Label Label5
Caption = "入庫藥品數量"
Height = 255
Left = 120
TabIndex = 9
Top = 1080
Width = 1095
End
Begin VB.Label Label4
Caption = "入庫藥品價格"
Height = 255
Left = 120
TabIndex = 7
Top = 1440
Width = 1095
End
Begin VB.Label Label3
Caption = "入庫時間"
Height = 255
Left = 120
TabIndex = 5
Top = 1800
Width = 1095
End
Begin VB.Label Label2
Caption = "入庫藥品類型"
Height = 255
Left = 120
TabIndex = 3
Top = 720
Width = 1095
End
Begin VB.Label Label1
Caption = "入庫藥品名稱"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 1095
End
End
End
Attribute VB_Name = "frm_im_add"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Fault_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
If Trim(Import_name.Text) = "" Then
MsgBox "藥品入庫名稱不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Import_type.Text) = "" Then
MsgBox "入庫藥品類型不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Import_num.Text) = "" Then
MsgBox "藥品入庫數量不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Import_price.Text) = "" Then
MsgBox "藥品入庫價格不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Import_time.Text) = "" Then
MsgBox "入庫時間不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Prodcom.Text) = "" Then
MsgBox "生產廠商不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Prodplace.Text) = "" Then
MsgBox "產地不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Buyer.Text) = "" Then
MsgBox "采購員不能為空!", vbOKOnly
Exit Sub
End If
If Trim(Checker.Text) = "" Then
MsgBox "驗收員不能為空!", vbOKOnly
Exit Sub
End If
OpenDB
Dim strSQL As String
strSQL = "Select * from Drug_Import"
'添加藥品入庫信息
objRS.Open strSQL, objConn, adOpenKeyset, adLockOptimistic
objRS.AddNew
objRS.Fields(1).Value = Trim(Import_name.Text)
objRS.Fields(2).Value = Trim(Import_type.Text)
objRS.Fields(3).Value = CDbl(Trim(Import_num.Text))
objRS.Fields(4).Value = CDbl(Trim(Import_price.Text))
'objRS.Fields(5).Value = CDate(Trim(Import_time.Text))
objRS.Fields(6).Value = Trim(Prodcom.Text)
objRS.Fields(7).Value = Trim(Prodplace.Text)
objRS.Fields(8).Value = Trim(Buyer.Text)
objRS.Fields(9).Value = Trim(Checker.Text)
objRS.Update
objRS.Close
CloseDB
MsgBox "記錄已添加!", vbOKOnly
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -