📄 frmtostock.frm
字号:
VERSION 5.00
Begin VB.Form frmToStock
BorderStyle = 3 'Fixed Dialog
Caption = "进货"
ClientHeight = 3150
ClientLeft = 45
ClientTop = 330
ClientWidth = 4515
Icon = "frmToStock.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 210
ScaleMode = 3 'Pixel
ScaleWidth = 301
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin MySuperMarket.FTextBox txtPrice
Height = 300
Left = 1200
TabIndex = 1
Top = 1200
Width = 3075
_extentx = 5424
_extenty = 529
font = "frmToStock.frx":000C
fontname = "宋体"
fontsize = 9
text = "0"
autoselall = -1 'True
isnumber = -1 'True
maxlength = 8
End
Begin MySuperMarket.FTextBox txtNum
Height = 300
Left = 1200
TabIndex = 0
Top = 720
Width = 3075
_extentx = 5424
_extenty = 529
font = "frmToStock.frx":0030
fontname = "宋体"
fontsize = 9
text = "0"
autoselall = -1 'True
isnumber = -1 'True
maxlength = 5
afterdecimal = 0
End
Begin MySuperMarket.XPButton cmdExit
Cancel = -1 'True
Height = 345
Left = 3180
TabIndex = 5
Top = 2640
Width = 1095
_extentx = 1931
_extenty = 609
caption = "取消"
capalign = 2
backstyle = 2
font = "frmToStock.frx":0054
mode = 0
value = 0 'False
cback = -2147483633
End
Begin MySuperMarket.XPButton cmdOK
Default = -1 'True
Height = 345
Left = 1980
TabIndex = 4
Top = 2640
Width = 1095
_extentx = 1931
_extenty = 609
caption = "确定"
capalign = 2
backstyle = 2
font = "frmToStock.frx":0078
mode = 0
value = 0 'False
cback = -2147483633
End
Begin MySuperMarket.FTextBox txtDate
Height = 300
Left = 1200
TabIndex = 3
Top = 2160
Width = 3075
_extentx = 5424
_extenty = 529
font = "frmToStock.frx":00A0
fontname = "宋体"
fontsize = 9
autoselall = -1 'True
End
Begin MySuperMarket.FTextBox txtMoney
Height = 300
Left = 1200
TabIndex = 2
Top = 1680
Width = 3075
_extentx = 5424
_extenty = 529
font = "frmToStock.frx":00C4
fontname = "宋体"
fontsize = 9
text = "0"
autoselall = -1 'True
isnumber = -1 'True
maxlength = 10
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "进货总额:"
Height = 180
Left = 240
TabIndex = 10
Top = 1755
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "进货日期:"
Height = 180
Left = 240
TabIndex = 9
Top = 2220
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "进货数量:"
Height = 180
Left = 240
TabIndex = 8
Top = 795
Width = 900
End
Begin VB.Label lbName
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "商品名称: "
Height = 180
Left = 240
TabIndex = 7
Top = 315
Width = 990
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "进货价格:"
Height = 180
Left = 240
TabIndex = 6
Top = 1260
Width = 900
End
End
Attribute VB_Name = "frmToStock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error GoTo aaaa
Dim d As Date, MID As String
If CLng(txtNum.Text) = 0 Then
MsgBox "进货数量必须大于0", vbInformation
txtNum.SetFocus
Exit Sub
End If
If CCur(txtPrice.Text) <= 0 Then
MsgBox "进货价格必须大于0", vbInformation
txtPrice.SetFocus
Exit Sub
End If
If CCur(txtMoney.Text) <= 0 Then
MsgBox "进货总额必须大于0", vbInformation
txtMoney.SetFocus
Exit Sub
End If
If IsDate(txtDate.Text) = False Then
MsgBox "请输入合法的计划进货日期。", vbInformation
txtDate.SetFocus
Exit Sub
End If
d = CDate(txtDate.Text)
cnMain.Execute "UPDATE Stock SET MerchPrice=" & txtPrice.Text & _
",MerchNum=" & txtNum.Text & ",TotalPrice=" & txtMoney.Text & _
",StockDate='" & txtDate.Text & "',StockState=1 Where StockID=" & Me.Tag
frmStock.List1.ListItems.Remove frmStock.List1.SelectedItem.Index
cnMain.Execute "UPDATE MerchInfo SET MerchNum=MerchNum+" & txtNum.Text & " Where MerchName='" & lbName.Tag & "'"
SetSB 2, "该计划进货记录入库成功."
Unload Me
Exit Sub
aaaa:
MsgBox Err.Description, vbCritical
Unload Me
End Sub
Private Sub Form_Load()
Move frmMain.Left + (frmMain.Width - Me.Width) / 2, frmMain.Top + (frmMain.Height - Me.Height) / 2
End Sub
Private Sub txtNum_Change()
CountSum
End Sub
Private Sub CountSum()
On Error GoTo aaaa
Dim c As Currency
c = CCur(txtNum.Text) * CCur(txtPrice.Text)
txtMoney.Text = c
Exit Sub
aaaa:
txtMoney.Text = 0
End Sub
Private Sub txtPrice_Change()
CountSum
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -