📄 main_qtgl_xs.frm
字号:
Width = 885
End
Begin VB.TextBox rq
Enabled = 0 'False
Height = 270
Left = 855
Locked = -1 'True
TabIndex = 7
Top = 75
Width = 1980
End
Begin VB.CommandButton ComEnd
BackColor = &H00C0C0C0&
Height = 360
Left = 10035
Picture = "main_qtgl_xs.frx":004B
Style = 1 'Graphical
TabIndex = 6
Top = 5130
Width = 1275
End
Begin VB.CommandButton Comqx
BackColor = &H00C0C0C0&
Enabled = 0 'False
Height = 360
Left = 8760
Picture = "main_qtgl_xs.frx":1A1B
Style = 1 'Graphical
TabIndex = 5
Top = 5130
Width = 1275
End
Begin VB.CommandButton Combc
BackColor = &H00C0C0C0&
Enabled = 0 'False
Height = 360
Left = 7470
Picture = "main_qtgl_xs.frx":34BE
Style = 1 'Graphical
TabIndex = 4
Top = 5130
Width = 1275
End
Begin VB.CommandButton Comdj
BackColor = &H00C0C0C0&
Height = 360
Left = 6195
Picture = "main_qtgl_xs.frx":4F63
Style = 1 'Graphical
TabIndex = 3
Top = 5130
Width = 1275
End
Begin MSFlexGridLib.MSFlexGrid MS1
Height = 3585
Left = 15
TabIndex = 1
Top = 780
Width = 11625
_ExtentX = 20505
_ExtentY = 6324
_Version = 393216
Rows = 1
Cols = 0
FixedRows = 0
FixedCols = 0
BackColor = 16777215
BackColorFixed = 8421504
ForeColorSel = 16777215
BackColorBkg = 16777215
GridColorFixed = 16777215
Enabled = 0 'False
ScrollBars = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSDataListLib.DataCombo ck
Bindings = "main_qtgl_xs.frx":6AAB
Height = 330
Left = 8940
TabIndex = 33
Top = 420
Width = 1905
_ExtentX = 3360
_ExtentY = 582
_Version = 393216
ListField = "仓库名称"
Text = ""
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "收款方式:"
Height = 240
Left = -15
TabIndex = 28
Top = 4800
Width = 1020
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "折扣: 折 税率: % 应收金额: 元"
Height = 315
Left = 6225
TabIndex = 25
Top = 4500
Width = 5445
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "仓 库 "
Height = 225
Left = 8220
TabIndex = 22
Top = 480
Width = 900
End
Begin VB.Label Label15
BackStyle = 0 'Transparent
Caption = "实收金额: 未收金额: 元"
Height = 255
Left = 3240
TabIndex = 18
Top = 4815
Width = 5940
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "销售品种: 合计数量: 合计金额: 元"
Height = 225
Left = 15
TabIndex = 17
Top = 4485
Width = 6885
End
Begin VB.Label Label4
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "录单票号"
Height = 180
Left = 2940
TabIndex = 12
Top = 135
Width = 795
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "录单日期"
Height = 180
Left = 60
TabIndex = 11
Top = 135
Width = 885
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "购买单位"
ForeColor = &H00000000&
Height = 255
Left = 60
TabIndex = 10
Top = 480
Width = 1215
End
Begin VB.Label Label19
BackStyle = 0 'Transparent
Caption = "经手人"
Height = 315
Left = 6495
TabIndex = 9
Top = 480
Width = 720
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 240
Left = 9105
TabIndex = 8
Top = 120
Width = 2265
End
Begin VB.Label wfje
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 210
Left = 8655
TabIndex = 2
Top = 5865
Visible = 0 'False
Width = 1455
End
End
Attribute VB_Name = "main_qtgl_xs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'定义数据集对象
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim rs4 As New ADODB.Recordset
Dim rs5 As New ADODB.Recordset
Dim rs6 As New ADODB.Recordset
Dim s, y, i, j '定义变量
Private Sub Form_Activate() '初始化设置
rq.Text = Date
Combo1.AddItem ("现金"): Combo1.AddItem ("转帐支票")
Combo1.AddItem ("汇票"): Combo1.ListIndex = 0
Me.Caption = Me.Caption & " 操作员:" & frm_main.czy.Text
End Sub
Private Sub Form_Load()
MS1.Rows = 102: MS1.Cols = 9 '定义MS1表的总行数、总列数
'定义MS1表格的列宽及表头
s = Array("300", "2100", "1200", "1800", "1500", "765", "1200", "1200", "1200")
y = Array("xh", "商品名称", "商品编号", "规格", "产地", "单位", "零售价", "数量", "金额")
For i = 0 To 8
MS1.ColWidth(i) = s(i): MS1.TextMatrix(0, i) = y(i)
Next i
MS1.FixedRows = 1: MS1.FixedCols = 1 '设置固定行、列
'定义MS1表的列序号
For i = 1 To 101
MS1.TextMatrix(i, 0) = i
Next i
rq.Text = Date '设置销售日期
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub ck_Change() '去除空格
ck.Text = Trim(ck.BoundText)
End Sub
Private Sub ck_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then '按回车键焦点到MS1表格的第一行第一列中
MS1.Row = 1: MS1.Col = 1
Text1.Visible = True 'text1输入框可见
Text1.SetFocus 'text1获得焦点
End If
End Sub
Private Sub jsr_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then ck.SetFocus
End Sub
Private Sub kh_Change() '查询客户全称或简称
DataList1.ReFill
Adodc1.RecordSource = "select * from kh where 客户全称 like '" + Trim(kh.Text) + "'+ '%'or 简称 like '" + Trim(kh.Text) + "'+ '%'"
Adodc1.Refresh
If kh.Text <> "" And Adodc1.Recordset.RecordCount > 0 Then DataList1.Visible = True
End Sub
Private Sub kh_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then '按回车键DataList1不可见
DataList1.Visible = False
jsr.SetFocus 'jsr获得焦点
End If
If KeyCode = vbKeyPageDown Then '按PageDown键,datalist1显示所有记录
DataList1.ReFill
DataList1.Visible = True
DataList1.SetFocus
End If
End Sub
Private Sub grid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
With Adodc2.Recordset
If .RecordCount > 0 Then '判断是否有记录
If .Fields("商品名称") <> "" Then
'赋值给MS1表格
If .Fields("商品名称") <> "" Then MS1.TextMatrix(MS1.Row, 1) = Trim(.Fields("商品名称"))
If .Fields("商品编号") <> "" Then MS1.TextMatrix(MS1.Row, 2) = Trim(.Fields("商品编号"))
If .Fields("规格") <> "" Then MS1.TextMatrix(MS1.Row, 3) = Trim(.Fields("规格"))
If .Fields("产地") <> "" Then MS1.TextMatrix(MS1.Row, 4) = Trim(.Fields("产地"))
If .Fields("单位") <> "" Then MS1.TextMatrix(MS1.Row, 5) = Trim(.Fields("单位"))
If .Fields("零售价") <> "" Then MS1.TextMatrix(MS1.Row, 6) = .Fields("零售价")
Text1.Text = MS1.Text '赋值给text1
Text1.SetFocus 'text1获得焦点
MS1.Col = 6
grid1.Visible = False 'grid1不可见
Else
MsgBox ("无数据选择!!!")
grid1.Visible = False
Text1.SetFocus
End If
End If
End With
Text1.SetFocus
End If
If KeyCode = vbKeyEscape Then '按ESC键grid1不可见
grid1.Visible = False
Text1.SetFocus 'text1获得焦点
End If
End Sub
Private Sub DataList1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
kh.Text = Trim(DataList1.BoundText) '赋值给kh.text
DataList1.Visible = False
End If
End Sub
Private Sub jsr_Change() '去除空格
jsr.Text = Trim(jsr.BoundText)
End Sub
Private Sub MS1_Click() '单击MS1表格
If MS1.Row >= 1 And MS1.TextMatrix(MS1.Row - 1, 7) <> "" Then
Text1.Visible = True
Text1.SetFocus
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -