On Mar 5, 1:55 pm, "Parasyke" <kress1963no...@yahoo.comwrote:
On Mar 5, 8:42 am, "storrboy" <storr...@sympatico.cawrote:
On Mar 4, 9:55 pm, "Parasyke" <kress1963no...@yahoo.comwrote:
Thanks anyone in advance... I have a product report that prints out
data about the product including a picture... at least that's what I
need to happen. On my report I have a linked Image with the two sets
of code that I've tried without any luck:
Note: on my form I have a TextBox named ImagePath that reads my image
path:
="\\MainServer\data\companyInventory\" & [Forms]![ProductForm]!
[ImagePathName] & "
on my report I've tried these two code blocks on the OnOpen event:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Eror Resume Next
Me!ImageItem.Picture = [Forms]![ProductForm]![ImagePath]
End Sub
and also:
Private Sub Report_Open(Cancel As Integer, FormatCount As Integer)
On Eror Resume Next
Me!ImageItem.Picture = [Forms]![ProductForm]![ImagePath]
End Sub
Any clues to the above or general "How To" on getting a Product Name
put into a textbox and the report reading the Product Name an getting
into the Report (?)
Thanks!Dav
You haven't indicated what is wrong. Are you getting an error message?
Image just not displaying?
="\\MainServer\data\companyInventory\" & [Forms]![ProductForm]!
[ImagePathName] & "
What is [ImagePathName]? Just file name or a longer path? Remove the &
" at the end.- Hide quoted text -
- Show quoted text -
Error states that it can't find the picture file and then takes me to
the debug screen in VB.
ImagePathName is the name of the textbox on the form.
This tells me a couple things...
1) You don't have error trapping in the code. This is why the code
window opens in debug mode. You should add some so that when a file in
not accessible (and there are a lot of reasons in a network
environment). A more appropriate message is displayed and the users
aren't prompted to view the code that caused it.
2) The filepath is invaid. Either in spelling, the way you've spliced
them together, or access across the network is denied in some fashion.
At some point in the code before you try to apply the image to the
control, add a line...
Debug.Print [Forms]![ProductForm]![ImagePath]
and post the result to see if the formatting is correct. At the same
time, make sure this path is real and accessible on the network.