XiaoHui.Net 笑汇程序员论坛
→ Visual Basic 讨论区
求助:这个问题怎么解决啊?
|
求助:这个问题怎么解决啊?
有一程序,运行时出现提示: 实时错误'94': 无效使用 Null,
到VB中调试时,指向语句: If Not mbClose Then [color=Red]grdScan.Row = LastRow - 1[/color]
红色字在鼠标指向时值为 grdScan.Row =0 LastRow= Null
我是外行,请问怎么改啊?
附:这段程序为:
Private Sub grdScan_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
''如果当前记录正处于编辑状态,则不允许在导航栏中移动记录
If Not mbClose Then grdScan.Row = LastRow - 1
''如果当前行改变,则动态改变所要显示的记录
If LastRow <> grdScan.Bookmark Then
If grdScan.ApproxCount > 0 Then
msSerial = grdScan.Columns(0).CellText(grdScan.Bookmark)
Call SeekTeacher(msSerial)
End If
End If
End Sub |
|
| 这个问题有没有人知道啊,我也想知道一下的哦,谢谢!! |
|
| LastRow 全局变量(form级或modle级),要不就在程序Load时初始一个值,比如0,-1,100000等,看你的代码处理需要 |
|
| grdScan.Row = iif(isnull(LastRow),0,LastRow) - 1 这样不知道行不行 |
| createhebe | 2008-9-30 08:55 |
|
LastRow赋初值啊~~
不过不建议使用Variant类型,虽然支持的比较多,可是容易出现问题的~ |
|