?? frmwarehouseupdate.frm
字號:
VERSION 5.00
Begin VB.Form frmWarehouseUpdate
Caption = "Form1"
ClientHeight = 6945
ClientLeft = 60
ClientTop = 345
ClientWidth = 9930
LinkTopic = "Form1"
ScaleHeight = 6945
ScaleWidth = 9930
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtName
Height = 375
Left = 6120
MaxLength = 20
TabIndex = 3
Top = 2880
Width = 2295
End
Begin VB.TextBox txtNo
Height = 375
Left = 2760
MaxLength = 10
TabIndex = 2
Top = 2880
Width = 1455
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 7440
TabIndex = 1
Top = 6120
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "確定"
Height = 375
Left = 6240
TabIndex = 0
Top = 6120
Width = 1095
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "倉庫名稱"
Height = 195
Left = 5280
TabIndex = 5
Top = 2880
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "倉庫編號"
Height = 195
Left = 1920
TabIndex = 4
Top = 2880
Width = 720
End
End
Attribute VB_Name = "frmWarehouseUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
'編輯倉庫
Dim objWarehouse As New clsWarehouse
With objWarehouse
.m_ID = frmWarehouse.ExcelGrid1.DataRecordset.Fields("ID").value
.m_Name = Me.txtName.Text
.m_No = Me.txtNo.Text
If Not .Update() Then
MsgBox "更新失敗,請檢查數據合法性!", vbInformation, "編輯倉庫"
Else
Unload Me
frmWarehouse.RefreshData
End If
End With
End Sub
Private Sub Form_Load()
'center the form
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
'寫入數據到界面
Me.txtName.Text = frmWarehouse.ExcelGrid1.DataRecordset.Fields("name").value
Me.txtNo.Text = frmWarehouse.ExcelGrid1.DataRecordset.Fields("empno").value
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -