vsflexgrid的奇怪问题,不知哪位神仙能解释一下?EditText?为什么事件vsfg_ChangeEdit()中
1.如下代码,则Set_StockAndPrice函数执行并没有起作用2.去掉条件If aa <> topart Then,则执行正确
3.如果不注释掉MsgBox CLBRowid & "," & itmcode & " ," & ProvLoc & " ," & topart,将执行MsgBox ,显示结果也正确
4.如果最后一行,也就是最后的End If ,设断点则执行结果也正确请问为什么有这个条件If aa <> topart Then,结果就不正确了?我认为是vsfg数据更新延迟,但是没有条件If aa <> topart Then,怎么就可以呢??
真是想不通Private Sub vsfg_ChangeEdit()
Dim topart As String
Dim itmcode As String
Dim ProvLoc As String
Dim CLBRowid As String
Dim aa As String
If vsfg.row > 0 And vsfg.Col = 6 Then
'查转换数值
CLBRowid = vsfg.TextMatrix(vsfg.row, 14)
itmcode = vsfg.TextMatrix(vsfg.row, 0)
topart = vsfg.EditText
ProvLoc = cmb_ProvideL.Text
aa = vsfg.TextMatrix(vsfg.row, 6)
If aa <> topart Then
'重新按该单位调出库存数量、价格
'MsgBox CLBRowid & "," & itmcode & " ," & ProvLoc & " ," & topart
Call Set_StockAndPrice(CLBRowid, itmcode, ProvLoc, topart)
Call CalCostsAndShow
Call Status(2)
End If
End If
End Sub其中函数Set_StockAndPrice(CLBRowid, itmcode, ProvLoc, topart)内有如下代码: With vsfg_Item
.TextMatrix(.RowSel, 4) = "ewqq"
.TextMatrix(.RowSel, 7) = "fsdfdsf"
.......
End With
1.如下代码,则Set_StockAndPrice函数执行并没有起作用2.去掉条件If aa <> topart Then,则执行正确
3.如果不注释掉MsgBox CLBRowid & "," & itmcode & " ," & ProvLoc & " ," & topart,将执行MsgBox ,显示结果也正确
4.如果最后一行,也就是最后的End If ,设断点则执行结果也正确请问为什么有这个条件If aa <> topart Then,结果就不正确了?我认为是vsfg数据更新延迟,但是没有条件If aa <> topart Then,怎么就可以呢??
真是想不通Private Sub vsfg_ChangeEdit()
Dim topart As String
Dim itmcode As String
Dim ProvLoc As String
Dim CLBRowid As String
Dim aa As String
If vsfg.row > 0 And vsfg.Col = 6 Then
'查转换数值
CLBRowid = vsfg.TextMatrix(vsfg.row, 14)
itmcode = vsfg.TextMatrix(vsfg.row, 0)
topart = vsfg.EditText
ProvLoc = cmb_ProvideL.Text
aa = vsfg.TextMatrix(vsfg.row, 6)
If aa <> topart Then
'重新按该单位调出库存数量、价格
'MsgBox CLBRowid & "," & itmcode & " ," & ProvLoc & " ," & topart
Call Set_StockAndPrice(CLBRowid, itmcode, ProvLoc, topart)
Call CalCostsAndShow
Call Status(2)
End If
End If
End Sub其中函数Set_StockAndPrice(CLBRowid, itmcode, ProvLoc, topart)内有如下代码: With vsfg_Item
.TextMatrix(.RowSel, 4) = "ewqq"
.TextMatrix(.RowSel, 7) = "fsdfdsf"
.......
End With
解决方案 »
- 刘慈欣的自动作诗机核心算法?
- 系列专题:【附源码】Windows Shell接口之VB实现(三):IThumbnailProvider接口 (缩略图)
- 怎么样单击触发DataGrid
- 链接网络数据库总是超时!SQL Server 2000 服务器!
- 怎么结贴,怎么给分呀
- 有没人知道在WINXP下面怎么安装vb5.0(急啊,,)
- 请教在广域网上如何使用用文件传输任务,EMAIL还是Socket呢,请指教了
- 如何找到combo控件的这个属性
- 如何利用vb进行域名和IP地址的正反向解析
- failed to load resource dll c:\windows\system\oledb32r.dll
- 很很很简单的问题
- listview 列号问题,急(在线~~~~~~~~~~~~~`)
只是在上述四种情况下,对于如下的执行结果不相同
With vsfg_Item
.TextMatrix(.RowSel, 4) = "ewqq"
.TextMatrix(.RowSel, 7) = "fsdfdsf"
.......
End With
.TextMatrix(.RowSel, 4) = "ewqq"
.TextMatrix(.RowSel, 7) = "fsdfdsf"
.......
End With
并非vsfg,是另一个VSFLEXGRID吧,那和你传进去的参数也没什么关系啊,怎么会结果不一样呢
Dim topart As String
Dim itmcode As String
Dim ProvLoc As String
Dim CLBRowid As String
Dim aa As String
If vsfg.row > 0 And vsfg.Col = 6 Then
'查转换数值
CLBRowid = vsfg.TextMatrix(vsfg.row, 14)
itmcode = vsfg.TextMatrix(vsfg.row, 0)
topart = vsfg.EditText
ProvLoc = cmb_ProvideL.Text
aa = vsfg.TextMatrix(vsfg.row, 6)
If aa <> topart Then
'重新按该单位调出库存数量、价格
'MsgBox CLBRowid & "," & itmcode & " ," & ProvLoc & " ," & topart
With vsfg
.TextMatrix(.RowSel, 4) = "ewqq"
.TextMatrix(.RowSel, 7) = "fsdfdsf"
.......
End With
End If
End If
End Sub
神了我解决了
在函数Set_StockAndPrice(CLBRowid, itmcode, ProvLoc, topart)内做了一点点改动(添加了.TextMatrix(.RowSel, 6)=topart),就OK了.但对最初为什么会出现那几种情况还是不明白,而且为什么这么改就OK也不明白??With vsfg_Item
.TextMatrix(.RowSel, 4) = "ewqq"
.TextMatrix(.RowSel, 7) = "fsdfdsf"
.TextMatrix(.RowSel, 6)=topart '这行添加的,我在vsfg_ChangeEdit里改的也是第6列
End With而我再写一个类似的程序,不用类似的添加 .TextMatrix(.RowSel, 6)=topart 就OK真是不可想象,这几行程序看了无数次了,不明白!!!
:)
好好想想可能是什么原因?