📄 frmstoreedit.frm
字号:
VERSION 5.00
Begin VB.Form frmstoreedit
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 5490
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 5490
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmd_cancel
Caption = "取 消"
Height = 495
Left = 2880
TabIndex = 4
Top = 1800
Width = 1335
End
Begin VB.CommandButton cmd_ok
Caption = "确 定"
Height = 495
Left = 720
TabIndex = 3
Top = 1800
Width = 1335
End
Begin VB.Frame Frame1
Height = 1215
Left = 240
TabIndex = 0
Top = 240
Width = 4935
Begin VB.TextBox txtstore
Height = 495
Left = 1560
TabIndex = 2
Top = 360
Width = 3015
End
Begin VB.Label Label1
Caption = " 仓库名称"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 1
Top = 480
Width = 1935
End
End
End
Attribute VB_Name = "frmstoreedit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public OriName As String
Public OriId As Long
Private Function Check() As Boolean
If Trim(txtstore) = "" Then
MsgBox "请输入仓库名称"
txtstore.SetFocus
Check = False
Exit Function
End If
Check = True
End Function
Private Sub Cmd_OK_Click()
If Check = False Then
Exit Sub
End If
With MyStore
.StoreName = MakeStr(txtstore)
'判断仓库名称是否存在
If Modify = False Or OriName <> Trim(txtstore) Then
If .In_DB(MakeStr(txtstore)) = True Then
MsgBox "仓库名称已经存在,请重新输入"
txtstore.SetFocus
txtstore.SelStart = 0
txtstore.SelLength = Len(txtstore)
Exit Sub
End If
End If
If Modify = False Then
.Insert
MsgBox "添加成功"
Else
.Update (OriId)
MsgBox "修改成功"
End If
End With
Unload Me
Unload frmstoreman
frmstoreman.Show 1
End Sub
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub txtStore_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -