📄 xsstysj.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "Msadodc.OCX"
Begin VB.Form xsstysj
BorderStyle = 3 'Fixed Dialog
Caption = "水桶饮水机的销售 "
ClientHeight = 5640
ClientLeft = 45
ClientTop = 330
ClientWidth = 8100
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "xsstysj.frx":0000
ScaleHeight = 5640
ScaleWidth = 8100
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 2280
TabIndex = 20
Top = 4680
Width = 1215
End
Begin VB.TextBox txtItem
DataField = "备注"
DataSource = "Adodc1"
Height = 600
Index = 5
Left = 1440
MaxLength = 5
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 15
Top = 3480
Width = 6375
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 6840
Top = 8280
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Password=515515;Persist Security Info=True;User ID=sa;Data Source=login"
OLEDBString = "Provider=MSDASQL.1;Password=515515;Persist Security Info=True;User ID=sa;Data Source=login"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from xsstysj"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame2
BackColor = &H00FF8080&
Caption = "商品信息"
Height = 2295
Left = 4080
TabIndex = 10
Top = 840
Width = 3735
Begin VB.ComboBox Combo1
DataField = "商品名"
DataSource = "Adodc1"
Height = 300
Left = 1320
TabIndex = 24
Text = "Combo1"
Top = 240
Width = 2175
End
Begin VB.TextBox txtItem
DataField = "数量"
DataSource = "Adodc1"
Height = 270
Index = 1
Left = 1320
MaxLength = 18
TabIndex = 0
Top = 720
Width = 2175
End
Begin VB.TextBox txtItem
DataField = "单价"
DataSource = "Adodc1"
Height = 270
Index = 2
Left = 1320
MaxLength = 10
TabIndex = 1
Top = 1080
Width = 2172
End
Begin VB.TextBox txtItem
DataField = "总金额"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 270
Index = 3
Left = 1320
MaxLength = 3
TabIndex = 2
Top = 1440
Width = 1572
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "单价:"
Height = 252
Index = 11
Left = 240
TabIndex = 14
Top = 1080
Width = 972
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "总金额:"
Height = 252
Index = 6
Left = 240
TabIndex = 13
Top = 1440
Width = 972
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "数量:"
Height = 255
Index = 5
Left = 240
TabIndex = 12
Top = 720
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "商品名:"
Height = 255
Index = 4
Left = 240
TabIndex = 11
Top = 360
Width = 975
End
End
Begin VB.Frame Frame1
BackColor = &H00FF8080&
Caption = "客户信息"
Height = 2295
Left = 240
TabIndex = 5
Top = 840
Width = 3735
Begin VB.TextBox Text4
DataField = "购买日期"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 375
Left = 1320
TabIndex = 21
Text = "Text4"
Top = 1680
Width = 2055
End
Begin VB.TextBox Text3
DataField = "客户地址"
DataSource = "Adodc1"
Height = 375
Left = 1320
TabIndex = 19
Text = "Text3"
Top = 1200
Width = 2055
End
Begin VB.TextBox Text2
DataField = "客户电话"
DataSource = "Adodc1"
Height = 375
Left = 1320
TabIndex = 18
Text = "Text2"
Top = 720
Width = 2055
End
Begin VB.TextBox Text1
DataField = "客户名"
DataSource = "Adodc1"
Height = 375
Left = 1320
TabIndex = 17
Text = "Text1"
Top = 240
Width = 2055
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "购买日期:"
Height = 255
Index = 3
Left = 240
TabIndex = 9
Top = 1680
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = " 客户名:"
Height = 255
Index = 0
Left = 360
TabIndex = 8
Top = 240
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "客户电话:"
Height = 255
Index = 1
Left = 240
TabIndex = 7
Top = 720
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "客户地址:"
Height = 255
Index = 16
Left = 240
TabIndex = 6
Top = 1200
Width = 975
End
End
Begin VB.CommandButton cmdExit
Caption = "返回 (&X)"
Height = 375
Left = 4440
TabIndex = 4
Top = 4680
Width = 1215
End
Begin VB.CommandButton cmdSave
Caption = "保存 (&S)"
Height = 375
Left = 2280
TabIndex = 3
Top = 4680
Width = 1215
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "Label3"
DataField = "单据编号"
DataSource = "Adodc1"
Height = 375
Left = 3960
TabIndex = 23
Top = 360
Width = 2415
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "单据编号:"
Height = 375
Left = 2640
TabIndex = 22
Top = 360
Width = 855
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "备注信息:"
Height = 255
Index = 2
Left = 360
TabIndex = 16
Top = 3600
Width = 975
End
End
Attribute VB_Name = "xsstysj"
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 cmdSave_Click()
cmdSave.Visible = False
Command1.Visible = True
End Sub
Private Sub Command1_Click()
On Error Resume Next
Adodc1.Recordset.AddNew
Adodc1.Recordset("单据编号") = Format(Date, "yy") & Format(Date, "mm") & Format(Date, "dd") & Int(Timer)
Adodc1.Recordset("客户名") = ""
Adodc1.Recordset("客户地址") = ""
Adodc1.Recordset("客户电话") = ""
Adodc1.Recordset("购买日期") = Format(Date, "yy-mm-dd")
Adodc1.Recordset("商品名") = ""
Adodc1.Recordset("单位") = ""
Adodc1.Recordset("数量") = Val(txtItem(1).Text)
Adodc1.Recordset("单价") = ""
Adodc1.Recordset("总金额") = Val(txtItem(1).Text) * Val(txtItem(2).Text)
Adodc1.Recordset("备注信息") = ""
Adodc1.Recordset("商品名") = Combo1.Text
Adodc1.Recordset.MoveLast
cmdSave.Visible = True
Command1.Visible = False
End Sub
Private Sub Form_Load()
Dim txtsql As String
Dim msgtext As String
Dim mrc As ADODB.Recordset
txtsql = "select distinct 商品名称 from goods"
Set mrc = ExecuteSQL(txtsql, msgtext)
If mrc.EOF = False Then
Do While Not mrc.EOF
Combo1.AddItem Trim(mrc.Fields(0))
mrc.MoveNext
Loop
Combo1.ListIndex = 0
End If
Command1.Visible = True
cmdSave.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -