?? frmfoodedie.frm
字號:
VERSION 5.00
Begin VB.Form FrmFoodEdit
Caption = "編輯食品基本信息"
ClientHeight = 4080
ClientLeft = 60
ClientTop = 450
ClientWidth = 6870
LinkTopic = "Form1"
ScaleHeight = 4080
ScaleWidth = 6870
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "關閉"
Height = 615
Left = 3960
TabIndex = 10
Top = 3360
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 615
Left = 1320
TabIndex = 9
Top = 3360
Width = 1455
End
Begin VB.Frame Frame1
Height = 3135
Left = 0
TabIndex = 0
Top = 0
Width = 6855
Begin VB.TextBox txtNo
Height = 375
Left = 1440
TabIndex = 4
Top = 240
Width = 1575
End
Begin VB.TextBox txtName
Height = 375
Left = 1440
TabIndex = 3
Top = 1200
Width = 1575
End
Begin VB.TextBox txtPrice
Height = 375
Left = 1440
TabIndex = 2
Top = 1800
Width = 1575
End
Begin VB.ComboBox ComboFoodClass
Height = 300
Left = 1440
TabIndex = 1
Text = "Combo1"
Top = 720
Width = 1575
End
Begin VB.Label Label1
Caption = "食品編號"
Height = 255
Left = 240
TabIndex = 8
Top = 240
Width = 1215
End
Begin VB.Label Label2
Caption = "食品名稱"
Height = 255
Left = 240
TabIndex = 7
Top = 1320
Width = 1215
End
Begin VB.Label Label3
Caption = "價格"
Height = 255
Left = 240
TabIndex = 6
Top = 1920
Width = 1215
End
Begin VB.Label Label4
Caption = "食品類型"
Height = 375
Left = 240
TabIndex = 5
Top = 720
Width = 1335
End
End
End
Attribute VB_Name = "FrmFoodEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriFoodNo As String
Private Sub Command1_Click()
If Trim(txtNo) = "" Then
MsgBox "請輸入食品編號"
txtNo.SetFocus
Exit Sub
End If
If Trim(ComboFoodClass.Text) = "" Then
MsgBox "請輸入食品類別"
ComboFoodClass.SetFocus
Exit Sub
End If
If Trim(txtName) = "" Then
MsgBox "請輸入食品名稱"
txtName.SetFocus
Exit Sub
End If
If Trim(txtPrice) = "" Then
MsgBox "請輸入食品價格"
txtPrice.SetFocus
Exit Sub
End If
With MyFood
.FoodNo = MakeStr(txtNo)
.FoodClass = MakeStr(ComboFoodClass.Text)
.FoodName = MakeStr(txtName)
.Price = MakeStr(txtPrice)
'Modify=False表示當前為插入新數據狀態;否則為修改數據狀態
If Modify = False Then
'判斷當前用戶是否存在
.Insert
Else
If Trim(FoodNo) = OriFoodNo Then
.Update (OriFoodNo)
Else
If .In_DB(OriFoodNo) = True Then
.Update (OriFoodNo)
Else
MsgBox "已經存在此類編號"
txtNo.SetFocus
Exit Sub
End If
End If
End If
End With
FrmFood.AdoFoodList.Refresh
Unload Me
End Sub
Private Sub txtPostcode_KeyPress(KeyAscii As Integer)
If In_Int(KeyAscii) = False Then
KeyAscii = 0
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
MyFood.Loadtype
ComboFoodClass.Clear
i = 0
Do While Arr_FoodClass(i) <> ""
ComboFoodClass.AddItem Arr_FoodClass(i)
i = i + 1
Loop
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -