需要帮助jpg。 [英] Need help with jpg.
问题描述
我们使用Access 2002.
我有一个表,其中包含一个存储在网络磁盘上的hiperlinks到jpgs的列。
我创建了一个表单,显示表格中的所有字段,包括图片。如果我使用和bmp图像的OLE对象都很好。问题是我不能用bmp。如果我尝试在图像框/绑定或未绑定的对象框/文本框上显示jpg或....没有任何显示。我在前两个记录上放了一个bmp并且它们有效;移动到第3个其他记录没有显示jpg。我不擅长编码,但我在某处读到了我可以创建一个可以解决方法的宏或代码。
可以帮我吗?它真的很适合我:)我已经阅读了几天用于编码的语法,但我公司不希望我花这么多时间自己训练
我可以使用宏还是需要编写代码?
如果解决方法需要一个按钮来打开表单中的图片,...不理想但是......所以就这样吧。
表名= table1
表格名称= ViewRecord
字段名称=照片
谢谢!
We use Access 2002.
I have a table that contains a column with hiperlinks to jpgs stored on a disk on the network.
I created a form that shows all the fields in the table including the pictures. If I use and OLE object with bmp images all is good. The problem is that I can''t use bmp. If I try to display a jpg on an image box/ bound or unbound object box / text box or.... nothing comes up. I put a bmp on the first 2 records and they work; as move to the 3rd the other records no jpg is displayed. I''m not good with coding but I read somewhere that I can create a macro or code that can be a workaround.
Can any1 help me? It''s really getting to me :) I''ve been reading for days on the syntax to use in coding but my company doesn''t want me to spend all this time "training myself"
Can I use a macro or do I need to write a code?
If the workaround needs a button to open the pic in the form, ..not the ideal but...so be it.
Table name= table1
Form name= ViewRecord
field name= Photo
Thanks!
推荐答案
OK因为我被链接的照片骗了,但是你应该可以使用表格的on Current事件。
O.K. it''s bee a while since I fooled with linked pics but you should be able to use the on Current event of the form.
好的,有些东西正常工作但不是全部。
1)我假设我需要使用第一种类型的图像持有者,而不是未绑定或绑定的OLE对象。
2)当我运行代码时,我收到一条错误,上面写着
运行时错误''2220' ':
Microsoft访问无法打开文件''T:\ SHARED FILES \\管理\大师和模具照片\ 040F-6F222032-TL.JPG#T:\ SHARED FILES \Administration\Master and Moulds照片\ 040F-6F222032-TL.JPG#。
>
基本上它会使我在table1中的链接变得简单,然后在它后面添加一个''#'。
如果我去debud我会得到以下突出显示
''Image42.Picture =照片''
这里是我使用的代码:
Private Sub Form_Current()
如果不是IsNull(照片)和Len(照片)> 0然后
Image42.Picture =照片
结束如果
结束子
谢谢!
OK, something is working but not all.
1) I''m assuming I need to use the first type of image holder, not the unbound or bound OLE object.
2) when I run the code I get an error that says"
"run-time error ''2220'':
Microsoft access can''t open the file ''T:\SHARED FILES\Administration\Masters and Molds Photos\040F-6F222032-TL.JPG#T:\SHARED FILES\Administration\Masters and Molds Photos\040F-6F222032-TL.JPG#.
Basically it dubles the link I have in the table1 and adds a '' # '' after it.
If I go to debud I get the following highlighted
'' Image42.Picture = Photo''
Here''s the code I used:
Private Sub Form_Current()
If Not IsNull(Photo) And Len(Photo) > 0 Then
Image42.Picture = Photo
End If
End Sub
THANKS!
好的因为我被链接的照片骗了,但是你应该可以使用表格的on Current事件。
O.K. it''s bee a while since I fooled with linked pics but you should be able to use the on Current event of the form.
对语法有疑问我也添加了 ME"!; :
Private Sub Form_Current()
如果不是IsNull(我!照片)和Len(我!照片)> 0然后
我!Image42.Picture =我!照片
结束如果
结束子
照片是我表中的列,其中包含指向图片的链接。
In doubt of the syntax I aslo added the " Me!" :
Private Sub Form_Current()
If Not IsNull(Me!Photo) And Len(Me!Photo) > 0 Then
Me!Image42.Picture = Me!Photo
End If
End Sub
"Photo" is the column in my table that holds the links to the pictures.
这篇关于需要帮助jpg。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!