今天装了一个Vista舰旗版,试用了一下。原来在2003下用的Access开发的系统,现在出现一个问题。打开主控面板时出现:运行时错误:‘2426’,你输入的函数不能用在这个表达式。
Set rs = New ADODB.Recordset
For i = 1 To 7
tmpName = "CmdBut" & Format(i, "0")
With Me(tmpName)
strsql = "select itemtext from usysmenuitem where mainitem=" & i & " and itemnumber=0;"
rs.Open strsql, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If Not rs.EOF Then
.Caption = rs(0)
End If
rs.Close
.OnMouseMove = "=MouseMoveOn(" & i & ")"
.OnMouseDown = "=MouseDown(" & i & ")"
.OnMouseUp = "=MouseUp(" & i & ")"
.OnClick = "=ChickButton(" & i & ")"
End With
Next
For i = 1 To 9
tmpName = "CmdIcon" & Format(i, "0")
With Me(tmpName)
.OnMouseMove = "=IconMoveOn(" & i & ")"
.OnClick = "=IconLableClick(" & i & ")"
End With
tmpName = "IconLable" & Format(i, "0")
With Me(tmpName)
.OnMouseMove = "=IconMoveOn(" & i & ")"
.OnClick = "=IconLableClick(" & i & ")"
End With
Next
Set rs = Nothing
ChickButton 1
红色这句出现问题。另外,在所有窗口中日期设为默认date()的,打开窗口全部变为:#名称?
编译又没有问题。不知为什么
[此贴子已经被作者于2007-5-24 19:00:21编辑过]
|