📄 frminadd.frm
字号:
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2400
TabIndex = 22
Top = 0
Width = 1935
End
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "日期:"
ForeColor = &H80000008&
Height = 255
Left = 4200
TabIndex = 21
Top = 600
Width = 495
End
Begin VB.Label Label5
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "产品名称"
Height = 255
Left = 2400
TabIndex = 20
Top = 1140
Width = 795
End
Begin VB.Label Label7
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "数量"
Height = 255
Left = 240
TabIndex = 19
Top = 1620
Width = 435
End
Begin VB.Label Label10
AutoSize = -1 'True
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "备注"
Height = 180
Left = 240
TabIndex = 18
Top = 2700
Width = 360
End
Begin VB.Line Line1
BorderWidth = 2
X1 = 60
X2 = 6780
Y1 = 960
Y2 = 960
End
Begin VB.Line Line2
BorderWidth = 2
X1 = 60
X2 = 6780
Y1 = 3660
Y2 = 3660
End
Begin VB.Line Line3
BorderWidth = 2
X1 = 120
X2 = 6840
Y1 = 4020
Y2 = 4020
End
Begin VB.Line Line4
X1 = 2340
X2 = 4380
Y1 = 420
Y2 = 420
End
Begin VB.Line Line5
BorderWidth = 2
X1 = 60
X2 = 60
Y1 = 960
Y2 = 3660
End
Begin VB.Line Line6
BorderWidth = 2
X1 = 6780
X2 = 6780
Y1 = 960
Y2 = 3660
End
Begin VB.Line Line7
X1 = 60
X2 = 6780
Y1 = 1440
Y2 = 1440
End
Begin VB.Line Line8
X1 = 60
X2 = 6780
Y1 = 1920
Y2 = 1920
End
Begin VB.Label Label12
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "金额"
Height = 255
Left = 2640
TabIndex = 17
Top = 1620
Width = 435
End
Begin VB.Line Line14
X1 = 60
X2 = 6780
Y1 = 2400
Y2 = 2400
End
Begin VB.Label label13
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "产品编号"
Height = 255
Left = 120
TabIndex = 16
Top = 1080
Width = 735
End
Begin VB.Line Line9
X1 = 960
X2 = 960
Y1 = 960
Y2 = 3660
End
Begin VB.Line Line10
X1 = 2220
X2 = 2220
Y1 = 960
Y2 = 1920
End
Begin VB.Line Line13
X1 = 3300
X2 = 3300
Y1 = 960
Y2 = 1980
End
Begin VB.Label Label15
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "年"
Height = 255
Left = 5400
TabIndex = 15
Top = 600
Width = 255
End
Begin VB.Label Label16
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "月"
Height = 255
Left = 6000
TabIndex = 14
Top = 600
Width = 195
End
Begin VB.Label Label17
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "日"
Height = 255
Left = 6600
TabIndex = 13
Top = 600
Width = 195
End
Begin VB.Label Label8
BackColor = &H00FFFF80&
BackStyle = 0 'Transparent
Caption = "供应商"
Height = 255
Left = 120
TabIndex = 12
Top = 2100
Width = 675
End
End
Attribute VB_Name = "FrmInAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
TxtYear = Year(Date)
TxtM = Month(Date)
TxtD = Day(Date)
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "select * from Instore"
Adodc1.Refresh
If Not Adodc1.Recordset.EOF Then
csql = "select max(入库单号) from instore"
Adodc1.RecordSource = csql
Adodc1.Refresh
TxtON = Val(Adodc1.Recordset(0)) + 1
Else
TxtON = 1
End If
TxtON.Text = Right(CStr(100000), 5) + TxtON
Adodc2.ConnectionString = conn
Adodc2.RecordSource = "select * from store"
End Sub
Private Sub 保存_Click()
For i = 0 To 4
If TxtIn(i) = "" Then
MsgBox "请输入完整信息!", vbCritical + vbOKOnly, "警告"
Exit Sub
End If
Next
Adodc1.RecordSource = "select * from Instore"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset(1) = TxtON
Adodc1.Recordset(7) = Date
For i = 0 To 4
Adodc1.Recordset(i + 2) = TxtIn(i)
Next
Adodc1.Recordset(8) = TxtIn(5)
Adodc1.Recordset.Update
Adodc1.Refresh
Adodc2.RecordSource = "select * from store where 产品编号 like '" & TxtIn(0) & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount = 0 Then
Adodc2.Recordset.AddNew
Adodc2.Recordset(0) = TxtIn(0)
Adodc2.Recordset(1) = TxtIn(1)
Adodc2.Recordset(2) = TxtIn(3)
Adodc2.Recordset(3) = TxtIn(2)
Adodc2.Recordset.Update
GoTo A
End If
Adodc2.Recordset("数量") = Adodc2.Recordset("数量") + Val(Trim(TxtIn(2)))
Adodc2.Recordset.Update
Adodc2.Refresh
A: MsgBox "保存成功!", vbInformation + vbOKOnly, "提示"
保存.Enabled = False
End Sub
Private Sub 打印_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -