📄 frmitemdata.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{EDEC951D-FC76-11D1-9ABD-444553540000}#2.3#0"; "CALCEDIT.OCX"
Object = "{E0B099CD-729C-11D2-840D-444553540000}#2.0#0"; "LISTTEXT.OCX"
Begin VB.Form frmItemData
BackColor = &H00C0C0C0&
Caption = "直运商品资料"
ClientHeight = 4935
ClientLeft = 60
ClientTop = 345
ClientWidth = 8355
LinkTopic = "Form1"
ScaleHeight = 4935
ScaleWidth = 8355
StartUpPosition = 3 '窗口缺省
Begin ListRefer.ListText litItemData
Height = 300
Left = 720
TabIndex = 9
Top = 60
Width = 1815
_ExtentX = 3201
_ExtentY = 556
BackColor = 16777215
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 ACEdit.CalcEdit txtEdit
Height = 255
Left = 4230
TabIndex = 8
Top = 0
Width = 855
_ExtentX = 1508
_ExtentY = 450
Enabled = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
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 VB.CommandButton cmdItemData
Caption = "全部取消"
Height = 375
Index = 6
Left = 7080
TabIndex = 7
Top = 2580
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "全部选择"
Height = 375
Index = 5
Left = 7080
TabIndex = 6
Top = 2175
Width = 1215
End
Begin VB.CommandButton cmdItemData
Height = 375
Index = 4
Left = 7410
Style = 1 'Graphical
TabIndex = 5
Top = 150
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "栏目设置"
Height = 375
Index = 3
Left = 7080
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.CommandButton cmdItemData
Caption = "筛选"
Height = 375
Index = 2
Left = 7080
TabIndex = 3
Top = 1280
Width = 1215
End
Begin VB.CommandButton cmdItemData
Height = 375
Index = 1
Left = 7080
Style = 1 'Graphical
TabIndex = 2
Top = 810
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 = 7080
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 3600
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton cmdItemData
Height = 375
Index = 7
Left = 7080
Style = 1 'Graphical
TabIndex = 1
Top = 400
UseMaskColor = -1 'True
Width = 1215
End
Begin MSFlexGridLib.MSFlexGrid msgGrid
Bindings = "frmItemData.frx":0000
Height = 3765
Left = 75
TabIndex = 0
Top = 405
Width = 6885
_ExtentX = 12144
_ExtentY = 6641
_Version = 65541
Cols = 12
FixedCols = 7
BackColor = 16777215
End
Begin VB.Label hlb
BackColor = &H8000000E&
Height = 255
Index = 0
Left = 7080
TabIndex = 11
Top = 4200
Width = 1215
End
Begin VB.Label lblItemData
Caption = "币种:"
Height = 255
Left = 120
TabIndex = 10
Top = 80
Width = 615
End
End
Attribute VB_Name = "frmItemData"
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 rdoResultset '声明数据表类型
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 mlngCol As Long '修改列
Private ToFormName As Object '输出窗体的名称
Private Const intfixl = 7 '偏移数量
Private Sub RefreshGrid(ByVal blnWhere As Boolean)
'是否过滤
'入参:blnWhere;blnWhere=True,则为筛选中调用,需把筛选条件加上;否则为常规调用
'功能:从对应视图取SQL语句并打开、初始化之
Dim strCurrency As String
Dim strSelect As String
Dim strFrom As String
Dim Strsql As String
Dim recRecordset As rdoResultset
Dim strWhere As String
Dim qrf As QueryDef
Dim lngCurrencyID As Long
'//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'// 取本次结算金额、本次结算数量算法(连接对照表的方法): //
'// '首先:因为本次结算金额、本次结算数量是针对本次单据业务ID的;所以,可通过ItemActivity表的lngItemActivityID字段 //
'// '和ItemActivityDetail表的lngItemActivityID字段将此二表连接起来;再通过ItemActivityDetail表的lngItemActivityDetailID字段 //
'// '和PurchaseToSale表的lngSaleActivityDetailID字段将此二表连接起来;这样一来表ItemActivity、ItemActivityDetail和PurchaseToSale就被有机连接起来了。 //
'// '再用ItemActivity中的lngItemActivityID作为取本次结算金额、本次结算数量记录的条件。把单据中取过来的单据业务ID作为参数传给lngItemActivityID //
'// '就得到了所有取本次结算金额、本次结算数量的记录(取PurchaseToSale表的全部字段)。 //
'// '然后:将上面生成的查询作为一个查询表(取别名PurchaseToSale)再同表ItemActivityDetail连接回去就得到了我们需要的结果。连接方法是 //
'// '通过ItemActivityDetail表的lngItemActivityDetailID字段和PurchaseToSale表的lngPurchaseActivityDetailID字段将二表连接起来。 //
'// '结束 //
'//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
If litItemData.TextMatrix(litItemData.ReferRow, 1) <> "" Then
lngCurrencyID = litItemData.TextMatrix(litItemData.ReferRow, 1)
Else
lngCurrencyID = 0
End If
With msgGrid
.Redraw = False
.FixedCols = 0
End With
With mclsGrid1.ListSet
'商品业务明细ID,单价,未结算金额,计算因子,销售数量,未结算数量
strSelect = "SELECT ID,Price,Format(未结算金额,'#.00') AS dblValue,dblFactor," _
& "' ' AS dblNowNumber,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("mlngCurrencyID") = lngCurrencyID
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 = intfixl
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -