link a combo box to a picture

oxicottin

Learning by pecking away....
Local time
Today, 09:49
Joined
Jun 26, 2007
Messages
891
Hello, I have a form that I enter information into 3 txt boxes and it gives
me an answer in another text box then I click view and it brings up a rpt
that gives me the list of 10 barcodes I need and directions on how to enter
some info from the form and it shows me a picture of scanable barcodes. What I want to do is on the form when I select an entry from on of the combo boxes (cboGuage) and when I click to get to the report it will show me the barcode related to the number selected from the cboGuage list. I have 10 numbers in the cboGuage list and 10 barcodes that coraspond to these numbers. How would I go about doing this?

Can you explain in newbie terms since I am just starting in access...Or give
me some links or tutorials on how to do this. I have been trying to figure
this out for over a week. Thanks!
 
Last edited:
Your problem is fairly easy to fix, but you need to give consistent information.

In the attached document you will see that the table in access does not = the list of jpg’s. You also have 11 not 10.

Post back with the correct information and I or someone may help you.
 

Attachments

Ansentry, I have counted these over and over and there are 11 in the width column and there are 11 .jpg pictures to match. The Guage has nothing to do with the picture. Like I said Im new...Sorry! What I want to do is this:

When I select an item from the Width combo box. That .jpg will show up on the report when I click the "Print" button. If you notice I have a picture on the report right now that is all the .jpg's in one picture. I just want to show one picture on the report. Example:

LBS 700
Gauge 0.014
Width 2.125
Total MLF 6.92

Now when I click print it takes me to the report and on that report I will have the 2.125.jpg picture show up because I selected 2.125 from the width combo box.
 
Last edited:
You said you had 10 but you had 11
I have 10 numbers in the cboGuage list and 10 barcodes that coraspond to these numbers.

Have a look at the document that I posted; you have different names for the JPG's and the list in the access table.

Example:

You have a jpg named 0.875.jpg but in the access table it is not listed, there is a 1.875.

Which is correct?
 
Your right! Im so sorry I didnt catch that in your .doc when I looked I just kept counting what was there... I made a mistake in the table I had it as 1.875 and its suposed to be 0.875. I fixed it this attachment. Sorry, this thing has got me worked up because I cant figure it out and I really appreciate you helping me on this!
 

Attachments

I forgot to mention that the MLF to LBS Conversion side of the form doesnt matter we never use that and I dont even have that on the report as well so the images dont have to pulled from anything from that side just the combo box thats under the LBS to MLF side. Sorry I was just looking at it trying to figure this out and noticed I forgot to mention that.
 
I was just about to ask you that question.

Here is your db back and working.

A couple of things that you will have to do;

1> Change the name of your folder that holds the jpgs to RejectSteelBarcodes same name just no spaces.

2>Put the folder in your c:\ drive

3> Open up the table tblJPG and check the path that I have used and where you have placed your jpg's are the same should be: C:\RejectSteelBarCodes

4> I have added another form that you can have a play with, you just select the code and the image will display the bar code.

Hope this is what you wanted.
 

Attachments

Ansentry, It works it finally works! man your the greatest!!!! I have a question though? Im using this at work exclusivly and the path wont be c:\drive and I also will be moving it from work to my home PC to work on it. I noticed in the tblJPG has a path for the pictures, would I have to change that everytime or is there some way I can just have the pictures in the same folder as the.mdb and it would find them? Also can you explain what you did? Man thanks again!
 
The new attachment will do what you want.

You just have to have the folder and the database file in the same directory.

If you want to have a look at the code, open the report in design view and select Detail / Properties and look at On Format.

I have also removed the table that held the .JPG paths.

Good Luck, hope the weather is better where you are, here it is cold and raining about 10c but it is welcome rain as we are in our 10th year of drought.
 

Attachments

I will have to check it out in the morning since it is 2am here and I have to get some sleep! I really appreciate your help with this :D It has been 90F here for about a week now with high huimity and I cant stand it :( I thought it was alway hot there in Australia? Well I will post back tomorrow due to I am falling asleep.......Thanks!

Oh any other cool tips or tricks that you have would be cool or if you have any tutorials or good websites on access...Later:D
 
Ok, I finally got it to work in my origional database except for one thing. the frm_LBStoMLFConversion is giving the wrong answers in the total MLF at the bottom? I cant figure out why. Here is an example of a correct config:

LBS 700
Guage 0.010
Width 2.125

Total MLF 9.69

Oh, I figured out what its doing. Its reading the ID for the width instead of the number 2.125. How do I fix this? Thanks!!
 
Have a look at the query that is the source for cboWidth, I moved the DataID to the second column. The I told the control txtDataID (which is on the form but hidden) to use column (1) (which is really the second column) as the source for its data
Code:
=cboWidth.column(1)

When you "count" columns is goes like this;

1st Column = 0
2nd Column = 1
3rd Column = 2
and so on..............

There you are.
 
Would it be easer if I used your test form from the test1.zip instead of the report and have everything on the form instead of going to the report. What I mean is the picture would just show up on the form and I could print the form but you had that other tbl in there for a picture path instead of \RejectSteelBarCodes\ like whats in the rpt. How would this be done? Thanks!
 
Your do NOT print forms they are for displaying data.

You print reports.

What you are doing is the right way. Don’t try to reinvent the wheel.

My form1 won't work now that I have deleted the tblJPG. There is an exercise for you.............get the combo on the form working again. When you have got it working or get stuck post back.

It is 12:23am Thursday morning here so I am of to bed.

Good night from the land DownUnder
 

Users who are viewing this thread

Back
Top Bottom