📄 frmprojectcost.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{D252F124-F62C-11D1-9ABD-444553540000}#1.0#0"; "CALENDAR.DLL"
Object = "{9C4B12C2-D5CE-11D1-9ABC-444553540000}#1.0#0"; "GATLCTRL.DLL"
Begin VB.Form frmProjectCost
BorderStyle = 3 'Fixed Dialog
Caption = "工程材料及费用开单"
ClientHeight = 5835
ClientLeft = 735
ClientTop = 675
ClientWidth = 8325
KeyPreview = -1 'True
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5835
ScaleWidth = 8325
ShowInTaskbar = 0 'False
Begin GATLCTRLLibCtl.CalEdit txtEdit
Height = 270
Left = 6975
OleObjectBlob = "frmProjectCost.frx":0000
TabIndex = 14
Top = 120
Width = 1110
End
Begin GACALENDARLibCtl.SpinEdit gspEdit
Height = 270
Left = 4395
OleObjectBlob = "frmProjectCost.frx":0081
TabIndex = 13
Top = 105
Width = 705
End
Begin VB.CommandButton cmdItemData
Height = 375
Index = 7
Left = 7005
Style = 1 'Graphical
TabIndex = 6
Top = 450
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.Data datItemData
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 7035
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 3690
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton cmdItemData
Height = 375
Index = 1
Left = 7005
Style = 1 'Graphical
TabIndex = 5
Top = 855
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "筛选(&F)"
Height = 375
Index = 2
Left = 7005
TabIndex = 4
Top = 1335
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "栏目设置(&M)"
Height = 375
Index = 3
Left = 7005
TabIndex = 3
Top = 1740
Width = 1215
End
Begin VB.CommandButton cmdItemData
Height = 375
Index = 4
Left = 7005
Style = 1 'Graphical
TabIndex = 2
Top = 3090
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "全部选择(&A)"
Height = 375
Index = 5
Left = 7005
TabIndex = 1
Top = 2220
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "全部取消(&U)"
Height = 375
Index = 6
Left = 7005
TabIndex = 0
Top = 2625
Width = 1215
End
Begin MSFlexGridLib.MSFlexGrid msgGrid
Bindings = "frmProjectCost.frx":0124
Height = 3615
Left = 120
TabIndex = 7
Top = 450
Width = 6735
_ExtentX = 11880
_ExtentY = 6376
_Version = 65541
Cols = 12
FixedCols = 7
BackColor = 16777215
End
Begin VB.Label hlb
BackColor = &H8000000E&
Height = 255
Index = 0
Left = 7080
TabIndex = 12
Top = 4080
Width = 1215
End
Begin VB.Label lblProjectCost
Caption = "%"
Height = 255
Index = 3
Left = 5115
TabIndex = 11
Top = 105
Width = 135
End
Begin VB.Label lblProjectCost
Caption = "币种:"
Height = 255
Index = 2
Left = 5460
TabIndex = 10
Top = 120
Width = 1575
End
Begin VB.Label lblProjectCost
Caption = "增值比例(&R)"
Height = 255
Index = 1
Left = 3360
TabIndex = 9
Top = 120
Width = 1005
End
Begin VB.Label lblProjectCost
Caption = "单位:"
Height = 255
Index = 0
Left = 150
TabIndex = 8
Top = 135
Width = 3165
End
End
Attribute VB_Name = "frmProjectCost"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'工程费用开单
'作者: 唐吉禹
'1998-7-20
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Private WithEvents mclsGrid1 As NewGrid '声明GRID类模块
Attribute mclsGrid1.VB_VarHelpID = -1
Private mlhls As Recordset '声明数据表类型
Private mlngID As String 'ID字符串
Private ytextRow As Integer '记录当前FLEXGRID单元的行号
Private ytextCol As Integer '记录当前FLEXGRID单元的列号
Private mlngCustomerID As Long '单位ID
Private mlngCurrencyID As Long '币种ID
Private blnIsCancel As Boolean '按钮退出吗
Private mintCloseCol As Integer '关闭列
Private ToFormName As Object '输出窗体的名称
Private mlngCol As Long '修改列
Private Const intfixl = 7 '偏移数量
Private Sub RefreshGrid(ByVal blnWhere As Boolean)
'入参:blnWhere;blnWhere=True,则为筛选中调用,需把筛选条件加上;否则为常规调用
'功能:从对应视图取SQL语句并打开、初始化之
Dim strSelect As String
Dim strFrom As String
Dim strSql As String
Dim recRecordset As Recordset
Dim strWhere As String
Dim qrf As QueryDef
'//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'// 取本次结算金额、本次结算数量算法(连接对照表的方法): //
'// '首先:因为本次结算金额、本次结算数量是针对本次单据业务ID的;所以,可通过ItemActivity表的lngItemActivityID字段 //
'// '和ItemActivityDetail表的lngItemActivityID字段将此二表连接起来;再通过ItemActivityDetail表的lngItemActivityDetailID字段 //
'// '和PurchaseToBill表的lngSaleActivityDetailID字段将此二表连接起来;这样一来表ItemActivity、ItemActivityDetail和PurchaseToBill就被有机连接起来了。 //
'// '再用ItemActivity中的lngItemActivityID作为取本次结算金额、本次结算数量记录的条件。把单据中取过来的单据业务ID作为参数传给lngItemActivityID //
'// '就得到了所有取本次结算金额、本次结算数量的记录(取PurchaseToBill表的全部字段)。 //
'// '然后:将上面生成的查询作为一个查询表(取别名PurchaseToBill)再同表ItemActivityDetail连接回去就得到了我们需要的结果。连接方法是 //
'// '通过ItemActivityDetail表的lngItemActivityDetailID字段和PurchaseToBill表的lngPurchaseActivityDetailID字段将二表连接起来。 //
'// '结束 //
'//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
With msgGrid
.Redraw = False
.FixedCols = 0
End With
With mclsGrid1.ListSet
strSelect = "SELECT ID,Price,Format(未开单,'#.00') AS dblValue," _
& "QrfProjectCost.dblFactor,QrfProjectCost.strUnitName,dblNumber,选择," & .SelectOfSql
strFrom = .FromOfSql
strWhere = .WhereOfSql
End With
strSql = strSelect & strFrom
If Len(strWhere) > 0 And blnWhere Then
strSql = strSql & " WHERE " & strWhere
End If
' Strsql = Strsql & " ORDER BY lngItemID"
Set qrf = gclsBase.BaseDB.CreateQueryDef("", strSql)
qrf.Parameters("mlngCustomerID") = mlngCustomerID
qrf.Parameters("mlngCurrencyID") = mlngCurrencyID
qrf.Parameters("DetailID") = mlngID
Set recRecordset = qrf.OpenRecordset
If Not recRecordset.EOF Then
recRecordset.MoveLast
recRecordset.MoveFirst
Set mlhls = recRecordset
inittext
End If
Set datItemData.Recordset = recRecordset
recRecordset.Close
Set recRecordset = Nothing
With msgGrid
.SelectionMode = flexSelectionFree
.FocusRect = flexFocusLight
.Redraw = True
End With
mclsGrid1.ListSetToGrid
mclsGrid1.SetupStyle
msgGrid.FixedCols = 7
msgGrid.ColWidth(1) = 0
msgGrid.ColWidth(2) = 0
msgGrid.ColWidth(3) = 0
msgGrid.ColWidth(4) = 0
msgGrid.ColWidth(5) = 0
msgGrid.ColWidth(6) = 420
qrf.Close
Set qrf = Nothing
If msgGrid.Rows > 1 Then
msgGrid.col = 6 '对第一列进行排序
msgGrid.ColSel = 6
msgGrid.Row = 1
msgGrid.RowSel = 1
msgGrid.Sort = 6
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -