Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 01-09-2011, 05:05 PM   #1
MyTech
Access VBA
 
Join Date: Jun 2010
Location: New York
Posts: 108
Thanks: 11
Thanked 2 Times in 2 Posts
MyTech is on a distinguished road
How to retrieve icons in Forms?

I am working on a "Toners Bought and Sold" database with a "Box" field keeping track if the toner was bought either normally packaged ('Closed' box), in an open box ('Open' box) or without a box ('No' box).

I have 3 BMP files saved on my computer, 1- a closed box, 2- an open box, 3- a big X standing for 'No box'.

I want to have a field in my form to display an icon in each record, depending on the contents in the "Box" field.


My question is how do I handle images in Access?
Can I put the pictures in a Table as OleObject field and retrieve them from there? (the 'Lookup' part I'm ok with)
Should I create a certain Module?

Please help.

MyTech is offline   Reply With Quote
Old 01-09-2011, 05:22 PM   #2
John Big Booty
AWF VIP
 
John Big Booty's Avatar
 
Join Date: Aug 2005
Location: Planet 10, by way of the Eighth Dimension
Posts: 8,263
Thanks: 113
Thanked 1,012 Times in 865 Posts
John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough
Re: How to retrieve icons in Forms?

Don't store images in your DB, this will cause unnecessary DB bloat. Simply store the images in a file and refer to their location as required. Have a look at the sample posted here for an example
__________________
...but they're only monkey boys!!!
John Big Booty is offline   Reply With Quote
Old 01-09-2011, 06:23 PM   #3
MyTech
Access VBA
 
Join Date: Jun 2010
Location: New York
Posts: 108
Thanks: 11
Thanked 2 Times in 2 Posts
MyTech is on a distinguished road
Re: How to retrieve icons in Forms?

Thank you John, good sample.

However, I have a problem.

I'm trying to do this in a continuous form and when I use your sample, ALL records are being changed instead of only the record selected.
Is there a small change I have to make in it?


EDIT:

I got it, I had to select a Control Source.
I'll report if everything ended up OK.


Last edited by MyTech; 01-09-2011 at 06:29 PM.
MyTech is offline   Reply With Quote
Old 01-09-2011, 06:45 PM   #4
John Big Booty
AWF VIP
 
John Big Booty's Avatar
 
Join Date: Aug 2005
Location: Planet 10, by way of the Eighth Dimension
Posts: 8,263
Thanks: 113
Thanked 1,012 Times in 865 Posts
John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough
Re: How to retrieve icons in Forms?

Ah, continuous forms they will always cause you problems with this sort of task.

Perhaps this link will give you some pointers.
__________________
...but they're only monkey boys!!!
John Big Booty is offline   Reply With Quote
Old 01-09-2011, 06:50 PM   #5
John Big Booty
AWF VIP
 
John Big Booty's Avatar
 
Join Date: Aug 2005
Location: Planet 10, by way of the Eighth Dimension
Posts: 8,263
Thanks: 113
Thanked 1,012 Times in 865 Posts
John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough
Re: How to retrieve icons in Forms?

The problem with continuous forms, is that with this sort of control, that varies from record to record, and is dependant on a reference from the current record. Is that all the controls will show the record/image that is related to the record that currently holds focus, rather than the appropriate record/image for each record. I believe that Access '07 may be a little more compliant in this area.
__________________
...but they're only monkey boys!!!
John Big Booty is offline   Reply With Quote
Old 01-09-2011, 07:02 PM   #6
MyTech
Access VBA
 
Join Date: Jun 2010
Location: New York
Posts: 108
Thanks: 11
Thanked 2 Times in 2 Posts
MyTech is on a distinguished road
Re: How to retrieve icons in Forms?

I'm Using 2010 and it's not any better. I tried setting the "Picture" property to "Me.BoxCombo.Column(2)" but no, it asks me for an actual file name.

Thank you anyway John for sharing your great ideas.

I'll try my luck in a new post.
MyTech is offline   Reply With Quote
Old 01-09-2011, 07:13 PM   #7
John Big Booty
AWF VIP
 
John Big Booty's Avatar
 
Join Date: Aug 2005
Location: Planet 10, by way of the Eighth Dimension
Posts: 8,263
Thanks: 113
Thanked 1,012 Times in 865 Posts
John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough John Big Booty is a jewel in the rough
Re: How to retrieve icons in Forms?

No luck with the solution offered by Roger in the link in my post #4?

__________________
...but they're only monkey boys!!!
John Big Booty is offline   Reply With Quote
Old 01-09-2011, 07:25 PM   #8
MyTech
Access VBA
 
Join Date: Jun 2010
Location: New York
Posts: 108
Thanks: 11
Thanked 2 Times in 2 Posts
MyTech is on a distinguished road
Re: How to retrieve icons in Forms?

My continuous form will contain hundreds of records, and growing.
As far I understood before your last comment, i thought I'll have to create a single form and set hundreds of records.

After your previous comment, I tested your DB and realized that I just have to fill 1 page.
I'll check it out throughly another time, Thank you very much.

MyTech is offline   Reply With Quote
Reply

Tags
form , icon , image , ole , table

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Icons olxx Forms 2 10-23-2009 08:38 AM
Icons Ripley General 3 12-28-2006 11:49 AM
Icons Oldsoftboss General 3 02-10-2003 12:16 AM
Access - forms data add/retrieve silky Forms 2 10-23-2001 07:42 AM
Icons callumwatson Forms 3 07-04-2001 02:09 AM




All times are GMT -8. The time now is 07:35 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World