设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[与其它组件] help帮改下这段代码!

[复制链接]
跳转到指定楼层
1#
发表于 2004-8-9 16:32:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
        If Left([Style], 3) = "uba" Then

            If Dir("\\sm-server\g\our photo\smartrend\bangle\" & Me.Style & ".jpg ") = "" Then

                If Dir("\\sm-server\g\our photo\wax-silver model\新款号-photo\" & Me.Style & ".jpg") <> "" Then

                    image.picture = "\\sm-server\g\our photo\wax-silver model\新款号-photo\" & Me.Style & ".jpg"

                Else

                    image.picture = ""

                End If

            Else

                image.picture = "\\sm-server\g\our photo\smartrend\bangle\" & Me.Style & ".jpg"

            End If

        ElseIf Left([Style], 2) = "ub" Then '尝试采用模糊方法打开图片

            If Dir("\\sm-server\g\our photo\smartrend\bracelet\" & Me.Style & "*.jpg ") = "" Then

                If Dir("\\sm-server\g\our photo\wax-silver model\新款号-photo\" & Me.Style & "*.jpg") <> "" Then

                    image.picture = Dir("\\sm-server\g\our photo\wax-silver model\新款号-photo\" & Me.Style & "*.jpg")

                    '这句赋值语句有问题 ,可否帮改下

                    '运行时显未:错误2220,不能打开文件ub0032e.jpg

                Else

                    image.picture = ""

                End If

            Else

                image.picture = Dir("\\sm-server\g\our photo\smartrend\bracelet\" & Me.Style & "*.jpg ")

            End If

        End If
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
 楼主| 发表于 2004-8-10 00:37:00 | 只看该作者

help帮改下这段代码!

问题解决了! Me.image.picture = ""

    Dim myfile, mypath1, mypath2, mypath3 As String

   

    mypath1 = "\\sm-server\g\our photo\smartrend\"

    mypath2 = "\\sm-server\g\our photo\wax-silver model\新款号-photo\"

    mypath3 = "\\sm-server\g\our photo\smartrend\ring\"

   

        If Left([Style], 3) = "uba" Then

            If Dir(mypath1 & "bangle\" & Me.Style & "*.jpg ") = "" Then '尝试采用模糊方法打开图片

                If Dir(mypath2 & Me.Style & "*.jpg") <> "" Then

                    myfile = Dir(mypath2 & Me.Style & "*.jpg")

                    image.picture = mypath2 & myfile

                Else

                    image.picture = ""

                End If

            Else

                myfile = Dir(mypath1 & "bangle\" & Me.Style & "*.jpg ")

                image.picture = mypath1 & "bangle\" & myfile

            End If

        ElseIf Left([Style], 2) = "ub" Then

            If Dir(mypath1 & "bracelet\" & Me.Style & "*.jpg ") = "" Then

                If Dir(mypath2 & Me.Style & "*.jpg") <> "" Then

                    myfile = Dir(mypath2 & Me.Style & "*.jpg")

                    image.picture = mypath2 & myfile

                Else

                    image.picture = ""

                End If

            Else

                myfile = Dir(mypath1 & "bracelet\" & Me.Style & "*.jpg ")

                image.picture = mypath1 & "bracelet\" & myfile

            End If    end if
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-30 20:42 , Processed in 0.103163 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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