Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 97 report, how to insert a image based on a field name...

Posted on 2006-07-12
9
Medium Priority
?
181 Views
Last Modified: 2010-07-27
I have a field called REFRENCE

so in a report I would like to create a frame, but dont know which kind ole object ??? then then in the properties of that frame i would like it to load as follows

="D:\PICTURES\[REFRENCE]PIC.JPG"

so if refrence is baby

then the path to the pic file would be

d:\pictures\babypic.jpg

and the picture should load..

also in a report is it possible to have a page header, detail, and page footer on the right side of a pictrure i.e. the picture is to the left of some text..

tks.
0
Comment
Question by:Ricky11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17088707
U could use the IMAGE control

then in code u do ctrlname.Picture  = "D:\PICTURES\[REFRENCE]PIC.JPG"
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17088737
Do u want to set the path dynamically or in design?

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17088871
sorry my mistake, almost there

create a image control on your report - it may ask u to select one. Dont worry, just select one then clear the image in report design - look in property Picture

Now in code, u can do this - where ctrlname is the name of your image control

    ctrlname.Properties("Picture") = "D:\PICTURES\" & Me.Reference & "PIC.jpg"

Assuming Reference is a field on your report

If not, change Me.Reference to whatever u want it to be


Regards to your 2nd question, yes, u can position your image control and insert your text accordingly, how u see fit
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ricky11
ID: 17106869
i am using acc 97

i inserted a picture then removed the pic from properties change the name of the picture frame to PICTURE, then in the on open event on the report i put your code

firstly i get ctrlname not defined???

then i changed it to this.

PICTURE = "D:\PICTURES\" & Me.Reference & "PIC.jpg"

then it cannot find me.reference when surely the same reference is used in the report query and is also being displayed elsewhere in the report.

then i did this

instead of pulling the reference from the query inside the report i did :
pic = [Forms]![products2].[Text54]
PICTURE = "D:\PICTURES\" & pic & "PIC.jpg"

this works,, but the picture firstly displayed in the center of the report and not even inside the image frame at all.

i tried it again and then it said i am unable to assign a property or image to the picture frame for some reasons..

0
 

Author Comment

by:Ricky11
ID: 17106887
wooops..

okay silly me i forgot ctrlname is the name of the frame!! okay it does work now but it still cannot find me.reference...

so i have changed it to & pic & which pulls the data from another open form

 
0
 

Author Comment

by:Ricky11
ID: 17106932
re image control i cannot position it so that the page header and detail are on the right side of the image contorl, they always appear underneath it.

tks.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17107516
sorry

me.reference

supposed to refer to your refid field, the one holding the value u want

0
 

Author Comment

by:Ricky11
ID: 17231997
wanted to follow up with you... i asked a simialr question you will see.

but i put the code in the on page event in a report. however when i print the report it prints the wrong image on each page for each record..

how do i put it in a on current, their is no on current on the report??? in acc 97

tks
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 total points
ID: 17239420
I think

Private Sub Report_Page()

is what u might be after
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question