By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,275 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

image in report in access

P: 6
Hi there i got recommended to this site by a mate who is doing an A-level project, as am I! i was wondering if anyone knows a simple way of putting a picture box in a report which displays the contents of a text book with the file path i.e i want the picture box to display
Expand|Select|Wrap|Line Numbers
  1. CurrentProject.Path & txtImageLocation
i have tried and tried to get this to work but for some reason im not given many options with an image box in a report, I dont understand unboun/ bound objects and am not sure whether this can help!!

thanks in advance for any help

johnny ward
Feb 28 '07 #1
Share this Question
Share on Google+
13 Replies


ADezii
Expert 5K+
P: 8,599
Hi there i got recommended to this site by a mate who is doing an A-level project, as am I! i was wondering if anyone knows a simple way of putting a picture box in a report which displays the contents of a text book with the file path i.e i want the picture box to display
Expand|Select|Wrap|Line Numbers
  1. CurrentProject.Path & txtImageLocation
i have tried and tried to get this to work but for some reason im not given many options with an image box in a report, I dont understand unboun/ bound objects and am not sure whether this can help!!

thanks in advance for any help

johnny ward
In the Open Event of your Report:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2.   Me![imgTest].Picture = "C:\Test\Test.bmp"
  3. End Sub
NOTE: CurrentProject.Path does not return the trailing backslash, you may have to add it to your Path e.g.
C:\Documents and Settings\security\My Documents
Feb 28 '07 #2

P: 6
In the Open Event of your Report:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2.   Me![imgTest].Picture = "C:\Test\Test.bmp"
  3. End Sub
NOTE: CurrentProject.Path does not return the trailing backslash, you may have to add it to your Path e.g.
C:\Documents and Settings\security\My Documents

I now have a run-time error 2427 and message:"You entered an expression that has no value"

HELP!!!
Mar 1 '07 #3

Rabbit
Expert Mod 10K+
P: 12,316
Did you change [imgtest] to the name of your control?
Mar 1 '07 #4

P: 6
yes i changed it to picImage which is my image box
Mar 1 '07 #5

Rabbit
Expert Mod 10K+
P: 12,316
Try:
Expand|Select|Wrap|Line Numbers
  1. Me!Image1.Properties("Picture") = "C:\Test\Test.bmp"
Mar 1 '07 #6

P: 6
im getting same error!!!:(

somehow i think reports dont like picture boxes and stuff cos it wont give me functionality with command buttons either
Mar 2 '07 #7

Rabbit
Expert Mod 10K+
P: 12,316
That's weird cause I tried it and it works for me.
Mar 2 '07 #8

NeoPa
Expert Mod 15k+
P: 31,186
im getting same error!!!:(

somehow i think reports dont like picture boxes and stuff cos it wont give me functionality with command buttons either
Did you change the file reference to refer to your picture? And how?
Can you post the code you're actually using.
Mar 3 '07 #9

P: 6
Expand|Select|Wrap|Line Numbers
  1.     picImage.Visible = True
  2.     picImage.Picture = CurrentProject.Path & txtImageLocation
  3.     cmdShowImage.Caption = "Hide Image"
  4.  
this is my code for how it works in a form, so why cant this work in a report?
Mar 23 '07 #10

NeoPa
Expert Mod 15k+
P: 31,186
The request for the code was only the second sentence :(
If you ignore the questions of the experts here, how do you expect us to help you?
Mar 23 '07 #11

NeoPa
Expert Mod 15k+
P: 31,186
I did notice in your code, though, that you don't add a '\' after the Path. The Path does NOT include a trailing '\' so this may be your problem (or maybe just one of them).
Expand|Select|Wrap|Line Numbers
  1. picImage.Picture = CurrentProject.Path & txtImageLocation
Mar 23 '07 #12

P: 6
thanks for your help, sorry it takes long to reply i am at college near enough 24/7 studying etc., so its difficult to get a spare minute to check up on the many forums i use
Mar 29 '07 #13

NeoPa
Expert Mod 15k+
P: 31,186
No problem Kojo.
As it's a forum, we don't expect immediate responses. Any time you post we can see that and respond appropriately.
Pleased to hear it's helped anyway :)
Mar 29 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.