How to display a image on my report based on Combo Box selection (1 Viewer)

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
hi please help i cant solve it , i read 1000000 post :cry::cry:
i make a form that can select a car type by combo box and value list all car type in it , i want to have the car logo on my report .
it means when i select BMW in car selection in my form , i see the car logo in my report when i want to print it . please help me ,and sory i am nooob in access.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:36
Joined
May 7, 2009
Messages
19,175
on your Car table, add a field (text) for the path of the image of your car.
on your report add an Image control and set it's Control source to the image field of the table.
 

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
on your Car table, add a field (text) for the path of the image of your car.
on your report add an Image control and set it's Control source to the image field of the table.
exacly thats my point ,how to connect ?
i add pic path to the 2 field and in control source in experetion builder i add =[Table1]![Field2] to it ,but it dosent work
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:36
Joined
May 7, 2009
Messages
19,175
do you have the pic path to the car table?
you add an Image control and set its control source to the pic path field

example:
tblCar( table)
ID (autonumber)
CarID (text)
CarModel (text)
Pic Path (text) (the path of the picture)



on your report an Image Control, and the Recordsource: [Pic Path]
 

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
do you have the pic path to the car table?
you add an Image control and set its control source to the pic path field

example:
tblCar( table)
ID (autonumber)
CarID (text)
CarModel (text)
Pic Path (text) (the path of the picture)



on your report an Image Control, and the Recordsource: [Pic Path]
i have a combo box for select car model that is connect with a tbl and field of pic path on it
 

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
You can see my file that i make and exacly see what i mean.
 

Attachments

  • BBB.accdb
    548 KB · Views: 152

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:36
Joined
May 7, 2009
Messages
19,175
on Vehicle form, add the Car Picture by clicking the button "Car Picture" and
browsing for the car picture (any picture for your sample).

you then print the report.
 

Attachments

  • BBB.zip
    65.7 KB · Views: 158

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
on Vehicle form, add the Car Picture by clicking the button "Car Picture" and
browsing for the car picture (any picture for your sample).

you then print the report.
Thank's a lot for your programming ,its very nice ,but i want to have the logo image of each brand in my report by just select the car type with combo box drop down list in my form .
nothing show in vehicle form , just select a car type text in list , like BMW and i have a logo image of it in my report. i dont want to select a file for each record .
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:36
Joined
May 7, 2009
Messages
19,175
i dont see any Logo image on the report.
 

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
exacly as i wrote in my post name i want to have the logo with my combo box selection
 

smtazulislam

Member
Local time
Today, 14:36
Joined
Mar 27, 2020
Messages
806
[B]arnelgp[/B] Give you good solution, you needs to upload some your car picture or Logo. Then test report, it will showed this picture.
 

smtazulislam

Member
Local time
Today, 14:36
Joined
Mar 27, 2020
Messages
806
See the test one report Capture.JPG
Capture.JPG
 
Last edited:

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
i dont know how to explain my aim :(( ,
mr arnelgp sulution as he edit my form, is to add a attachment button for it ,but i want to link the logo pictures to my combo box
i dont want attach each time for car's logo , its my daily work for car inpection program , i want to link all logo to their name's in the combo box , and dont show me the logo in form , just in my report when in want to print it . sorry my english is not good as yours maybe missundrestanding in some point .
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:36
Joined
Feb 28, 2001
Messages
27,001
i make a form that can select a car type by combo box and value list all car type in it , i want to have the car logo on my report .
it means when i select BMW in car selection in my form , i see the car logo in my report when i want to print it .

I am going back to the original problem statement. I will tell you as clearly as I can what I would do, which doesn't mean I'm exactly right and any of the others are wrong. This is just MY take on it.

To do this, I would include some kind of code or index in the combo box to correspond to the car type that was selected. The combo box can have multiple columns. One of them should be the code. When you store the record about the car, include the code that you extract from the correct column of the combo box, regardless of any name that shows up in another column.

This code should tie back to a table that contains a hyperlink to the logo / image that you want displayed. Or just a file spec. It is possible that you would store this spec as a short text field in the table that drives the combo box. The code would probably be the prime key of that table.

The format of that file specification will depend on details of your setup, but at the minimum would be either the drive letter, path, name, and type, or the UNC network path, name, and type of the image file. Depending on how you are sharing this, the UNC choice might be better. You DON'T CARE if this is more than 100 characters. The table will only list each path once based on the code, which should be the prime key of the table.

Now in the report, in the detail section where this car record would be displayed, you have the a recordset that shows you specific details including the selection code. You can either use a JOIN in the query that defines the report's .RecordSource OR you could have a DLookup to recover the file spec. (I would use a JOIN myself.)

On the report in the detail section, you need to have an image control. In the detail section's ON FORMAT routine, you need a small amount of code that will look up that spec (if not JOINed) or just pick up the spec from the recordset and load it to the image controls .Picture property. You might have to "diddle" the other image properties dealing with aspect ratios, sizes, etc., but that is how I would approach the problem.

I didn't tell you in code. I used my words so that you could try to make sense of it. Sometimes it isn't what you say but how you say it.
 

sbr_1718

New member
Local time
Today, 16:06
Joined
Aug 8, 2020
Messages
10
thaks all i solve my problem , that was very easy but i dont know , bcs i am noob :))
 

Users who are viewing this thread

Top Bottom