📄 frm_xsmodify.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Frm_xsmodify
BorderStyle = 1 'Fixed Single
Caption = "销售信息更改"
ClientHeight = 5265
ClientLeft = 3960
ClientTop = 3090
ClientWidth = 8190
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5265
ScaleWidth = 8190
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 5640
TabIndex = 21
Top = 2640
Width = 1815
_ExtentX = 3201
_ExtentY = 661
_Version = 393216
Format = 25296897
CurrentDate = 39395
End
Begin VB.Timer Timer1
Interval = 60
Left = 3840
Top = 120
End
Begin VB.CommandButton Cmdexit
Caption = "退出"
Height = 400
Left = 4800
TabIndex = 20
Top = 4680
Width = 855
End
Begin VB.CommandButton Cmdmodify
Caption = "修改"
Default = -1 'True
Height = 400
Left = 2040
TabIndex = 19
Top = 4680
Width = 855
End
Begin VB.Frame Frame2
Height = 735
Left = 120
TabIndex = 18
Top = 4440
Width = 7935
End
Begin VB.Frame Frame1
Height = 4455
Left = 120
TabIndex = 0
Top = 0
Width = 7935
Begin VB.TextBox Text1
Height = 375
Index = 7
Left = 1680
TabIndex = 7
Top = 3600
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 5
Left = 1680
TabIndex = 8
Top = 2760
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 6
Left = 5520
TabIndex = 6
Top = 1920
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 4
Left = 1680
TabIndex = 5
Top = 2040
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 3
Left = 5520
TabIndex = 4
Top = 1200
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 2
Left = 1680
TabIndex = 3
Top = 1200
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 5520
TabIndex = 2
Top = 360
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1680
TabIndex = 1
Top = 360
Width = 1815
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "总数量"
Height = 255
Left = 4560
TabIndex = 17
Top = 1920
Width = 615
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "连锁店名称"
Height = 255
Left = 360
TabIndex = 16
Top = 3600
Width = 975
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "销售日期"
Height = 255
Left = 4440
TabIndex = 15
Top = 2760
Width = 735
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "总金额"
Height = 255
Left = 720
TabIndex = 14
Top = 2760
Width = 615
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "价格"
Height = 255
Left = 960
TabIndex = 13
Top = 2040
Width = 375
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "规格"
Height = 255
Left = 4800
TabIndex = 12
Top = 1200
Width = 375
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "药品名称"
Height = 255
Left = 600
TabIndex = 11
Top = 1200
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "药品类型名称"
Height = 255
Left = 4080
TabIndex = 10
Top = 360
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "销售编号"
Height = 255
Left = 600
TabIndex = 9
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "Frm_xsmodify"
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 Cmdmodify_Click()
Dim AdoRs As New ADODB.Recordset
AdoRs.Open " select * from 销售表 where 销售编号 = '" & Text1(0).Text & "' order by 销售编号 ", cnn, adOpenKeyset, adLockOptimistic
If AdoRs.RecordCount > 0 Then
c = MsgBox("确认要修改信息吗?")
If vbOK Then
For i = 0 To 3
If Text1(1).Text <> "" Then AdoRs.Fields(i) = Trim(Text1(i).Text)
Next i
AdoRs.Fields("价格") = Val(Text1(4).Text)
AdoRs.Fields("总金额") = Val(Text1(5).Text)
AdoRs.Fields("总数量") = Text1(6).Text
AdoRs.Fields("销售日期") = DTPicker1.Value
AdoRs.Fields("连锁店名称") = Text1(7).Text
AdoRs.Update
Frm_xsxx.Adodc1.Refresh
Else
If IsNumeric(Text1(0).Text) = False Then
MsgBox "请输入数字!"
Text1(0).SetFocus
Exit Sub
End If
If Text1(0).Text = "" Or Text1(1).Text = "" Or Text1(2).Text = "" Then
MsgBox "重要内容不能为空!"
Text1(0).SetFocus
Exit Sub
End If
End If
End If
AdoRs.Close
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -