设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[模块/函数] 怎么样让Access窗体图片控件从多个文件夹依次找图片显示

[复制链接]
1#
发表于 2016-12-26 10:19:02 | 显示全部楼层
else部分还是加上再看看吧。
  1. Sub Form_Current()
  2. Dim PhotoPath As String
  3. Dim PhotoPath2 As String
  4. PhotoPath = CurrentProject.Path & "\主图" & Me![产品编号] & ".jpg"
  5. PhotoPath2 = CurrentProject.Path & "\副图" & Me![产品编号] & ".jpg"
  6. If Dir(PhotoPath) = "" Then
  7. PhotoPath = PhotoPath2
  8. ElseIf Dir(PhotoPath2) = "" Then
  9. PhotoPath = CurrentProject.Path & "\2.jpg"
  10. Else
  11. PhotoPath=""
  12. End If
  13. Me.pic.Picture = PhotoPath
  14. End Sub
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-15 23:00 , Processed in 0.082044 second(s), 23 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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