frmF8 .frm
上传用户:dszmning
上传日期:2022-02-19
资源大小:129k
文件大小:5k
- VERSION 5.00
- Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
- Begin VB.Form frmF8
- BorderStyle = 3 'Fixed Dialog
- Caption = "取单"
- ClientHeight = 4185
- ClientLeft = 45
- ClientTop = 435
- ClientWidth = 6960
- KeyPreview = -1 'True
- LinkTopic = "Form5"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4185
- ScaleWidth = 6960
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton cmdOK
- Caption = "提取[ENTER]"
- Default = -1 'True
- Height = 495
- Left = 3720
- TabIndex = 5
- Top = 3443
- Width = 1095
- End
- Begin VB.CommandButton cmdExit
- Cancel = -1 'True
- Caption = " 退出 [ESC]"
- Height = 495
- Left = 5040
- TabIndex = 4
- Top = 3443
- Width = 1095
- End
- Begin VB.Frame Frame1
- Height = 3255
- Left = 120
- TabIndex = 2
- Top = 0
- Width = 6615
- Begin MSFlexGridLib.MSFlexGrid Grid1
- Height = 3015
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 6375
- _ExtentX = 11245
- _ExtentY = 5318
- _Version = 393216
- Cols = 5
- FixedCols = 0
- FormatString = "单 据 号 码|商 品 名 称|商品数量|商品价格|商品编号"
- End
- End
- Begin VB.TextBox Text1
- Height = 375
- Left = 1680
- TabIndex = 1
- Top = 3503
- Width = 1695
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "要提取的单号:"
- Height = 180
- Left = 480
- TabIndex = 3
- Top = 3600
- Width = 1260
- End
- End
- Attribute VB_Name = "frmF8"
- 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 cmdOK_Click() '提取选定单号的数据
- Dim rs As ADODB.Recordset, strSQL As String, str1 As String
- If Trim(Text1.Text) = "" Then
- MsgBox "请输入或选择需要提取的单号!", vbCritical + vbOKOnly, "警告"
- Grid1.SetFocus '设置输入焦点
- Exit Sub '退出过程
- End If
- strSQL = "SELECT a.saleno, b.barcode,b.GoodsName,a.salemoneyt,a.salenumt,a.GoodsID " & _
- "FROM saletemp a,goods b WHERE a.GoodsID=b.GoodsID AND a.saleno='" & _
- Trim(Text1.Text) & "'" '选择临时表中指定销售单号的数据
- Set rs = QueryExt(strSQL) '执行SQL语句
- Do While Not rs.EOF
- str1 = rs!barcode & vbTab '条码
- str1 = str1 & rs!GoodsName & vbTab '商品名称
- str1 = str1 & rs!salemoneyt & vbTab '单价
- str1 = str1 & rs!salenumt & vbTab '数量
- str1 = str1 & "100" & vbTab '折扣
- str1 = str1 & rs!salemoneyt * rs!salenumt & vbTab '合计
- str1 = str1 & rs!GoodsID '商品编号
- frmMain.Grid1.AddItem str1 '将商品信息添加到主窗体表格
- frmMain.txtSaleID.Text = rs!saleno '销售单号
- rs.MoveNext '处理下一记录
- Loop
- rs.Close
- frmMain.Summary '调用主窗体的汇总过程
- strSQL = "DELETE FROM saletemp WHERE saleno=" & Text1.Text '删除已提单的数据
- SQLExt strSQL '执行SQL语句
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim rs As ADODB.Recordset, strSQL As String, str1 As String
- strSQL = "SELECT a.saleno,b.GoodsName,a.salenumt,a.salemoneyt,a.GoodsID " & _
- "FROM saletemp a,goods b WHERE a.GoodsID=b.GoodsID"
- Set rs = QueryExt(strSQL)
- Grid1.Rows = 1
- Do While Not rs.EOF
- If Left(rs!saleno, 1) = POSID Then '是当前POS机的挂单
- str1 = Trim(rs!saleno) & vbTab '单号
- str1 = str1 & rs!GoodsName & vbTab '商品名称
- str1 = str1 & rs!salenumt & vbTab '商品数量
- str1 = str1 & rs!salemoneyt & vbTab '商品价格
- str1 = str1 & rs!GoodsID '商品编号
- Grid1.AddItem str1 '将商品信息添加到表格中
- End If
- rs.MoveNext '处理下一记录
- Loop
- rs.Close
- End Sub
- Private Sub Grid1_SelChange()
- With Grid1
- Text1.Text = .TextMatrix(.Row, 0) '将销售单号填入文本框
- End With
- End Sub