梦见别人把蛇砍成两段:对spread的几个操作
来源:百度文库 编辑:偶看新闻 时间:2024/04/29 01:30:04
对spread的几个操作
‘在两个spread表格中复制一行fpdoutmemo->fpdoutmemo2
‘SrcRow源行号
‘DetRow目的行号
Private Sub CopiMemo(SrcRow As Long, DetRow As Long)
Dim i As Integer
With fpdOutmemo2
If DetRow > .MaxRows Then ‘如果需要复制的行超过目的的最大行
Exit Sub
End If
.Row = DetRow: fpdOutmemo.Row = SrcRow ‘定位行
For i = 1 To fpdOutmemo.MaxCols ‘复制一行中的每一列
.Col = i: fpdOutmemo.Col = i
.Text = fpdOutmemo.Text
Next i
End WithEnd Sub ‘在fpdOutmemo2表格中插入一行
‘SrcRow源行号
Private Sub InsertMemo(SrcRow As Long)
With fpdOutmemo2
.MaxRows = .MaxRows + 1 ‘增加一个行
Call CopiMemo(SrcRow, .MaxRows)
End WithEnd Sub ‘fpdOutmemo2,并不删掉,只是把选择去掉
Private Sub DelMemo2(DetRow As Long)
Dim i As Long
With fpdOutmemo2
.Col = 1‘选择框
.Text = 0
End With
End Sub
‘fpdOutmemo2,删除
Private Sub DelMemo3()
Dim i As Long
Dim j As Long
With fpdOutmemo2
j = 0
For i = i To .MaxRows
.Col = 1
.Row = i
If .Text = 0 Then
.DeleteRows i, 1‘删除行
j = j + 1
End If
Next i
.MaxRows = .MaxRows - j‘更新最大行记录数,否则会出现空白行
End With
End Sub ‘查找表格中相同的记录在fpdoutmemo中查找和fpdoutmemo2中相同的记录
Private Function FindMemo2(SrcRow As Long) As Long
Dim strOutMemo As String
Dim strProductid As String
Dim strOutMemo2 As String
Dim strProductid2 As String
Dim i As LongFindMemo2 = 0
With fpdOutmemo2
If SrcRow > .MaxRows Then
FindMemo2 = 0 ‘没有找到
Exit Function
End If
.Row = SrcRow
.Col = INT_FPMEMO_KEY_OUTMEMOID ‘单证号
strOutMemo = .Text
.Col = INT_FPMEMO_KEY_PRODUCTID ‘成品号
strProductid = .Text
End With
With fpdOutmemo
If .MaxRows = 0 Then
FindMemo2 = 0 ‘没有找到
Exit Function
End If
For i = 1 To .MaxRows
.Row = i
.Col = INT_FPMEMO_KEY_OUTMEMOID
strOutMemo2 = .Text
.Col = INT_FPMEMO_KEY_PRODUCTID
strProductid2 = .Text
‘只有在两条记录的单证号和成品号都相等的情况,才算找到
If strOutMemo = strOutMemo2 And strProductid = strProductid2 Then
FindMemo2 = i ‘返回找到的记录的行
Exit Function
End If
Next i
End With
End Function
‘在两个spread表格中复制一行fpdoutmemo->fpdoutmemo2
‘SrcRow源行号
‘DetRow目的行号
Private Sub CopiMemo(SrcRow As Long, DetRow As Long)
Dim i As Integer
With fpdOutmemo2
If DetRow > .MaxRows Then ‘如果需要复制的行超过目的的最大行
Exit Sub
End If
.Row = DetRow: fpdOutmemo.Row = SrcRow ‘定位行
For i = 1 To fpdOutmemo.MaxCols ‘复制一行中的每一列
.Col = i: fpdOutmemo.Col = i
.Text = fpdOutmemo.Text
Next i
End WithEnd Sub ‘在fpdOutmemo2表格中插入一行
‘SrcRow源行号
Private Sub InsertMemo(SrcRow As Long)
With fpdOutmemo2
.MaxRows = .MaxRows + 1 ‘增加一个行
Call CopiMemo(SrcRow, .MaxRows)
End WithEnd Sub ‘fpdOutmemo2,并不删掉,只是把选择去掉
Private Sub DelMemo2(DetRow As Long)
Dim i As Long
With fpdOutmemo2
.Col = 1‘选择框
.Text = 0
End With
End Sub
‘fpdOutmemo2,删除
Private Sub DelMemo3()
Dim i As Long
Dim j As Long
With fpdOutmemo2
j = 0
For i = i To .MaxRows
.Col = 1
.Row = i
If .Text = 0 Then
.DeleteRows i, 1‘删除行
j = j + 1
End If
Next i
.MaxRows = .MaxRows - j‘更新最大行记录数,否则会出现空白行
End With
End Sub ‘查找表格中相同的记录在fpdoutmemo中查找和fpdoutmemo2中相同的记录
Private Function FindMemo2(SrcRow As Long) As Long
Dim strOutMemo As String
Dim strProductid As String
Dim strOutMemo2 As String
Dim strProductid2 As String
Dim i As LongFindMemo2 = 0
With fpdOutmemo2
If SrcRow > .MaxRows Then
FindMemo2 = 0 ‘没有找到
Exit Function
End If
.Row = SrcRow
.Col = INT_FPMEMO_KEY_OUTMEMOID ‘单证号
strOutMemo = .Text
.Col = INT_FPMEMO_KEY_PRODUCTID ‘成品号
strProductid = .Text
End With
With fpdOutmemo
If .MaxRows = 0 Then
FindMemo2 = 0 ‘没有找到
Exit Function
End If
For i = 1 To .MaxRows
.Row = i
.Col = INT_FPMEMO_KEY_OUTMEMOID
strOutMemo2 = .Text
.Col = INT_FPMEMO_KEY_PRODUCTID
strProductid2 = .Text
‘只有在两条记录的单证号和成品号都相等的情况,才算找到
If strOutMemo = strOutMemo2 And strProductid = strProductid2 Then
FindMemo2 = i ‘返回找到的记录的行
Exit Function
End If
Next i
End With
End Function
恼人的spread(VB)
spread控件的问题
求救 小弟需要spread 控件的简介
CMOS懂的进来:FSB spread specturm
BIOS里面的spread apectrum 是什么意思?
linux几个操作的问题!
有高人用过 vb的插件spread的吗?
哪位有关于spread的中文资料的地址
哪有吉他琴桥卖啊 spread&music电木吉他用的
asp对文件的操作
PHP对MYSQL的操作
VC对文本文件的操作
Spread Spectrum
关于实况8的几个操作问题
请问以下的操作是不是对的
2003服务器对 access 数据库的操作
对硬盘的损害操作有哪些?
那些操作对硬盘的伤害最大?
asp对数据库的操作问题???
哪些操作容易对硬盘伤害的??
对文件夹的操作有哪些方法
网络对拷是怎样操作的?
怎么冲破对复制操作的限制?
C++中对文件目录的操作