📄 main_rcyw_tsxs.frm
字号:
Width = 7380
Begin VB.Label rq
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 3870
TabIndex = 14
Top = 270
Width = 1665
End
Begin VB.Label PH
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 1080
TabIndex = 13
Top = 270
Width = 1485
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "票 号: 销售日期:"
Height = 180
Left = 225
TabIndex = 4
Top = 270
Width = 4350
End
End
Begin VB.Frame Frame2
Height = 645
Left = 15
TabIndex = 1
Top = 405
Width = 4200
Begin VB.TextBox jsr
BackColor = &H00FFFFFF&
Height = 270
Left = 975
TabIndex = 20
Top = 240
Width = 2580
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = " 经手人:"
ForeColor = &H00000000&
Height = 255
Left = 105
TabIndex = 2
Top = 285
Width = 840
End
End
Begin VB.TextBox text1
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
Height = 210
Left = 330
TabIndex = 0
Top = 1335
Visible = 0 'False
Width = 1485
End
Begin MSFlexGridLib.MSFlexGrid MS1
Height = 3435
Left = 30
TabIndex = 5
Top = 1080
Width = 11535
_ExtentX = 20346
_ExtentY = 6059
_Version = 393216
BackColor = 12713963
BackColorFixed = -2147483636
BackColorBkg = 16777215
ScrollBars = 2
End
Begin VB.Frame Frame4
Height = 645
Left = 0
TabIndex = 6
Top = 4485
Width = 7470
Begin VB.ComboBox Combo1
Height = 300
ItemData = "main_rcyw_tsxs.frx":0CDF
Left = 4845
List = "main_rcyw_tsxs.frx":0CE1
TabIndex = 21
Top = 240
Width = 690
End
Begin VB.Label zhje
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 210
Left = 6465
TabIndex = 22
Top = 285
Width = 660
End
Begin VB.Label hjje
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 210
Left = 3195
TabIndex = 17
Top = 285
Width = 810
End
Begin VB.Label hjsl
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 1860
TabIndex = 16
Top = 285
Width = 450
End
Begin VB.Label pz
BackStyle = 0 'Transparent
ForeColor = &H0000FF00&
Height = 210
Left = 615
TabIndex = 15
Top = 285
Width = 360
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "品种: 合计数量: 合计金额: 元 折扣: 折后金额: 元"
ForeColor = &H00800000&
Height = 315
Left = 90
TabIndex = 7
Top = 285
Width = 7350
End
End
Begin VB.Frame Frame5
Height = 645
Left = 7455
TabIndex = 8
Top = 4485
Width = 4110
Begin VB.CommandButton CmdReg
BackColor = &H00FF8080&
Caption = "&D 登记"
Height = 390
Left = 105
Picture = "main_rcyw_tsxs.frx":0CE3
TabIndex = 12
Top = 180
Width = 960
End
Begin VB.CommandButton CmdSave
BackColor = &H00C0C0C0&
Caption = "&S 保存"
Enabled = 0 'False
Height = 390
Left = 1065
Picture = "main_rcyw_tsxs.frx":1EC1
TabIndex = 11
Top = 180
Width = 960
End
Begin VB.CommandButton CmdCancel
BackColor = &H00FF8080&
Caption = "&C 取消"
Enabled = 0 'False
Height = 390
Left = 2025
Picture = "main_rcyw_tsxs.frx":309F
TabIndex = 10
Top = 180
Width = 960
End
Begin VB.CommandButton CmdEnd
BackColor = &H00FF8080&
Caption = "&E 退出"
Height = 390
Left = 3000
Picture = "main_rcyw_tsxs.frx":427D
TabIndex = 9
Top = 180
Width = 960
End
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "图 书 销 售 凭 证"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 285
Index = 0
Left = 4515
TabIndex = 18
Top = 105
Width = 2655
End
End
Attribute VB_Name = "main_rcyw_tsxs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim s, Y, i '声明变量
Dim Zj As Double
'声明数据集对象
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim lsph As Integer '声明一个整型变量
Private Sub Combo1_Click()
If Combo1.text = "全价" Then
Zj = 1
Else
Zj = Combo1.ListIndex / 10
End If
zhje.Caption = Val(hjje.Caption) '计算折后金额
End Sub
Private Sub Form_Load()
'自动识别路径
Adodc1.ConnectionString = "DSN=NBooks"
Adodc1.RecordSource = "select * from kcb"
Adodc1.Refresh
Adodc2.ConnectionString = "DSN=NBooks"
Adodc2.RecordSource = "select * from xsb"
Adodc2.Refresh
Adodc3.ConnectionString = "DSN=NBooks"
Adodc3.RecordSource = "select * from kcb"
Adodc3.Refresh
'定义MS1表格的行数、列数
MS1.Rows = 102
MS1.Cols = 10
'定义MS1表格的列宽和表头信息
s = Array("300", "800", "800", "2600", "900", "1400", "1000", "1000", "800", "800", "800", "1000")
Y = Array("xh", "书号", "条形码", "书名", "作者", "出版社", "类别", "单价", "销售数量", "金额")
For i = 0 To 9
MS1.ColWidth(i) = s(i)
MS1.TextMatrix(0, i) = Y(i)
Next i
'定义MS1表格的行号
For i = 1 To 101
MS1.TextMatrix(i, 0) = i
Next i
rq.Caption = Date '设置销售日期
Combo1.AddItem "全价"
For i = 1 To 9
Combo1.AddItem (i) & "折"
Next i
Combo1.text = "全价"
jsr.Enabled = False
MS1.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub grid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then '当按回车键时
With Adodc1.Recordset
If .RecordCount > 0 Then '当记录数大于零
If .Fields("书号") <> "" Then
'赋值给MS1表格
If .Fields("书号") <> "" Then MS1.TextMatrix(MS1.Row, 1) = .Fields("书号")
If .Fields("条形码") <> "" Then MS1.TextMatrix(MS1.Row, 2) = .Fields("条形码")
If .Fields("书名") <> "" Then MS1.TextMatrix(MS1.Row, 3) = .Fields("书名")
If .Fields("作者") <> "" Then MS1.TextMatrix(MS1.Row, 4) = .Fields("作者")
If .Fields("出版社") <> "" Then MS1.TextMatrix(MS1.Row, 5) = .Fields("出版社")
If .Fields("图书类别") <> "" Then MS1.TextMatrix(MS1.Row, 6) = .Fields("图书类别")
If .Fields("单价") <> "" Then MS1.TextMatrix(MS1.Row, 7) = .Fields("单价")
Text1.text = MS1.text
Text1.SetFocus
MS1.Col = 8 '到达第8列
Grid1.Visible = False
Else
MsgBox "库存没有图书信息可供选择!", , "图书综合管理系统"
Grid1.Visible = False 'grid1不可见
Text1.SetFocus
End If
End If
End With
Text1.SetFocus 'text1获得焦点
End If
If KeyCode = vbKeyEscape Then '按ESC键
Grid1.Visible = False 'grid1不可见
Text1.SetFocus 'text1获得焦点
End If
End Sub
Private Sub jsr_GotFocus()
jsr.BackColor = &HFFFF00 '设置颜色
End Sub
Private Sub jsr_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then '按回车键
Text1.Visible = True
'到达第1行,第1列
MS1.Row = 1
MS1.Col = 1
Text1.SetFocus
End If
End Sub
Private Sub jsr_LostFocus()
jsr.BackColor = &HFFFFFF '设置颜色
End Sub
Private Sub MS1_Click()
If MS1.Row >= 1 And MS1.TextMatrix(MS1.Row - 1, 9) <> "" Then '在MS1表格第1行或大于第1行时
Text1.Visible = True 'text1可见
Text1.SetFocus
End If
End Sub
Private Sub MS1_entercell()
Dim X, Y, p As String '定义字符串变量
If MS1.CellWidth <= 0 Or MS1.CellHeight <= 0 Then Exit Sub
X = MS1.TextMatrix(MS1.FixedRows, MS1.Col)
Y = MS1.TextMatrix(MS1.Row, 0)
If Y <> "" Then
If MS1.Col - MS1.LeftCol <= 3 Then MS1.LeftCol = MS1.LeftCol + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -