📄 dlgaddporduct.frm
字号:
VERSION 5.00
Begin VB.Form dlgAddPorduct
BorderStyle = 3 'Fixed Dialog
Caption = "添加产品类别"
ClientHeight = 2760
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 6030
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2760
ScaleWidth = 6030
ShowInTaskbar = 0 'False
Begin VB.TextBox Text3
Height = 495
Left = 1080
TabIndex = 7
Text = "Text3"
Top = 960
Width = 3855
End
Begin VB.TextBox Text2
Height = 375
Left = 1080
TabIndex = 5
Top = 480
Width = 3975
End
Begin VB.TextBox Text1
Height = 375
Left = 1080
TabIndex = 3
Text = "Text1"
Top = 0
Width = 4095
End
Begin VB.CommandButton CancelButton
Caption = "取消"
Height = 375
Left = 3600
TabIndex = 1
Top = 1920
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "确定"
Height = 375
Left = 1080
TabIndex = 0
Top = 1920
Width = 1215
End
Begin VB.Label Label5
Caption = "支数:"
Height = 255
Left = 360
TabIndex = 6
Top = 1080
Width = 615
End
Begin VB.Label Label2
Caption = "颜色:"
Height = 255
Left = 360
TabIndex = 4
Top = 600
Width = 615
End
Begin VB.Label Label1
Caption = "产品批号:"
Height = 255
Left = 120
TabIndex = 2
Top = 120
Width = 975
End
End
Attribute VB_Name = "dlgAddPorduct"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public frm1 As Form
Public bHaveFrm As Boolean
Private Sub CancelButton_Click()
Unload Me
End Sub
Private Sub Form_Load()
If bHaveFrm Then
Text1.Text = frm1.Text2.Text
End If
End Sub
Private Sub OKButton_Click()
Dim strName As String, strSQl As String
strName = Trim(Text1.Text)
If strName = "" Then
MsgBox "产品批号为空,请添写。"
Text1.SetFocus
Exit Sub
End If
'在库存中增加品种,重量先置为0
strSQl = "select * from stock where 批号='" & strName & "'"
Dim rsStock As New ADODB.Recordset
rsStock.CursorLocation = adUseClient
rsStock.Open strSQl, pubConn, adOpenDynamic, adLockOptimistic
If rsStock.RecordCount <> 0 Then
MsgBox "批号重复,请修改批号。"
Text1.SetFocus
rsStock.Close
Set rsStock = Nothing
Exit Sub
End If
rsStock.AddNew
rsStock!批号 = strName
rsStock!重量 = 0
If Trim(Text2.Text) <> "" Then
rsStock!颜色 = Trim(Text2.Text)
End If
If Trim(Text3.Text) <> "" Then
rsStock!支数 = Trim(Text3.Text)
End If
rsStock.Update
rsStock.Close
Set rsStock = Nothing
If bHaveFrm Then
frm1.Text2.Text = strName
frm1.Text7.Text = Trim(Text2.Text)
frm1.Text8.Text = Trim(Text3.Text)
frm1.bSure = True
End If
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -