设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1138|回复: 0
打印 上一主题 下一主题

[Access本身] [已解决]IF语句提示语法错误,特此请教!

[复制链接]
跳转到指定楼层
1#
发表于 2007-12-26 10:24:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
已经解决,是自己搞错了,不好意思!!!


调试这个程序时,提示IF语句语法错误,请诸位朋友帮我看一下
完整程序如下:

Private Sub Form_Load()
Dim Ctrl As Control
    For Each Ctrl In Me.Controls
        If TypeOf Ctrl Is TextBox Then
                Ctrl."d:\Word\" & Me.文件编号 & ".doc"")"
              End If
    Next
End Sub


'增加一个过程吧,用FileExistCheck("路径")来调用

Public Function FileExistCheck(ByVal strFileName As String) As Integer
''测试路径是否有效
'这段代码更好
'返回0代表文件或路径不存在
'返回1代表该文件存在
'返回2代表该文件夹存在

    Dim intAttr As Integer

    On Error GoTo Err:

    FileExistCheck = 0

    If Len(strFileName) > 0 Then
    *****在运行时,提示这条IF语句语法错误!*******


        intAttr = GetAttr(strFileName)

        If (intAttr And vbDirectory) Then
            FileExistCheck = 2      '
        Else
            FileExistCheck = 1      '
        End If

    End If

    Exit Function
Err:

End Functi

[ 本帖最后由 REORX 于 2007-12-26 11:27 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-15 23:51 , Processed in 0.088502 second(s), 24 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表