Access交流中心

北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |

跟据查询结果显示图片已做出来但没有图片问题就大了

my way  发表于:2010-03-03 17:43:16  
复制

ODER表不能更改因为是系统导出来的,现在能查询图但如果没有图会提示两次,没有两张图就会提示4次烦,

可不可以只提示一次或忽略

还有更好的方法请引路

谢谢!

点击下载此附件

 

Top
王樵民 发表于:2010-03-04 09:15:55

提示一次的代码如下:

Public cs

Private Sub Report_Load()
cs = 0
End Sub

Private Sub Report_Open(Cancel As Integer)
    DoCmd.Maximize

End Sub

Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer)
Dim strFilename As String
strFilename = CurrentProject.Path + "\jpg\" & Me.cstyle & ".jpg"
If Dir(strFilename) = "" Then
Me.img2.Visible = False
If cs = 0 Then
  strMsg1 = "文件不存在:" & strFilename
   MsgBox strMsg1, 48, ""
   
    cs = 1
End If
Else
    Me.img2.Visible = True
    Me.img2.Picture = strFilename
End If


End Sub

不提示的代码如下:

Option Compare Database


Private Sub Report_Open(Cancel As Integer)
    DoCmd.Maximize

End Sub

Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer)
Dim strFilename As String
strFilename = CurrentProject.Path + "\jpg\" & Me.cstyle & ".jpg"
If Dir(strFilename) = "" Then


  strMsg1 = "文件不存在:" & strFilename
   'MsgBox strMsg1, 48, ""
   Me.img2.Visible = False
  
End If
Else
    Me.img2.Visible = True
    Me.img2.Picture = strFilename
End If


End Sub



总记录:1篇  页次:1/1 9 1 :