📄 pgdxx.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form pgdxx
Caption = "打印派工单"
ClientHeight = 4110
ClientLeft = 60
ClientTop = 345
ClientWidth = 6315
LinkTopic = "Form1"
ScaleHeight = 4110
ScaleWidth = 6315
StartUpPosition = 3 '窗口缺省
Begin MSFlexGridLib.MSFlexGrid msglist
Height = 3135
Left = 120
TabIndex = 2
Top = 120
Width = 6135
_ExtentX = 10821
_ExtentY = 5530
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3240
TabIndex = 1
Top = 3480
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "打印"
Height = 375
Left = 1200
TabIndex = 0
Top = 3480
Width = 1455
End
End
Attribute VB_Name = "pgdxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public txtsql As String
Dim mrc As ADODB.Recordset
Dim msgtext As String
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
ShowTitle
ShowData
End Sub
Private Sub ShowData()
Dim j As Integer
Dim i As Integer
txtsql = "select * from dhd where 单据号= ' " & Trim(FRMpg.Combo1.Text) & " ' "
Set mrc = ExecuteSQL(txtsql, msgtext)
With msglist
.Rows = 1
Do While Not mrc.EOF
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
Select Case mrc.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
End Select
Next i
.TextMatrix(.Rows - 1, i + 1) = FRMpg.Combo2.Text & ""
.TextMatrix(.Rows - 1, i + 2) = Format(FRMpg.Combo3.Text & "", "yy-mm-dd")
mrc.MoveNext
Loop
End With
mrc.Close
End Sub
Private Sub ShowTitle()
Dim i As Integer
With msglist
.Cols = 15
.TextMatrix(0, 1) = "单据号"
.TextMatrix(0, 2) = "客户名"
.TextMatrix(0, 3) = "客户地址"
.TextMatrix(0, 4) = "电话"
.TextMatrix(0, 5) = "备用电话"
.TextMatrix(0, 6) = "订货时间"
.TextMatrix(0, 7) = "商品名称"
.TextMatrix(0, 8) = "单位"
.TextMatrix(0, 9) = "数量"
.TextMatrix(0, 10) = "单价"
.TextMatrix(0, 11) = "总计金额"
.TextMatrix(0, 12) = "备注"
.TextMatrix(0, 13) = "送水员"
.TextMatrix(0, 14) = "派工时间"
'固定表头
.FixedRows = 1
'设置各列的对齐方式
For i = 0 To 5
.ColAlignment(i) = 0
Next i
.ColAlignment(6) = 7
.ColAlignment(7) = 7
For i = 8 To 9
.ColAlignment(i) = 0
Next i
'表头项居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
'设置单元大小
.ColWidth(0) = 300
.ColWidth(1) = 1000
.ColWidth(2) = 2000
.ColWidth(3) = 2000
.ColWidth(4) = 1000
.ColWidth(5) = 1000
.ColWidth(6) = 1000
.ColWidth(7) = 1000
.ColWidth(8) = 1000
.ColWidth(9) = 1000
.Row = 1
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -