How make images display from a folder

SteveL

Registered User.
Local time
Yesterday, 18:52
Joined
Dec 3, 2004
Messages
60
I have a form in Access (2003) which has a combox box. When the user selects a record from the combo box I have another field which populates with a path to a folder on the computer which contains several folders. Each folder is named the same as the record selected in the combo box. But I need to create an afterupdate event on the combo box that will make the images (up to 6 total) display on the form that live in that specific folder. How can I do this?
 
Just checking.. nobody has responded to my question... is there anyone can can offer any suggestions as to how I can go about this project?

--Steve
 
You know Steve, there are a lot of ways to show images on a Form and how those images are displayed can depend on how the Form is setup.

Does the Form have a Default View of Single Form or is it Continuous Form? What if there are 7 or 10 Images an not 6.

I think the best way to do this is have the Form as a Continuous Form and dynamically create and place the Image Controls on Form as needed.

Can you Post a sample DB?

.
 
The way the form is to work is this...
1) The user selects a record from the combo box.
2) Depending on the record selected, thefield to the right of the combo box fills with data from the table, tblLots. This information is for the user's reference only.
3) Then also the field right under the combo box opens with a path to where the phots are. This path is dependant on the "PhotoLoc" info again coming from tblLots. There will be up to 6 images in any given folder.
4) Depending on the 3rd character in the key field in tblLots, a tabbed form will be visible. If it is a "C" then the Commercial tab should be visible. If it is a "R" then the Residential tab will be visible. In either case, the other tab is not visible. That is probably all the other code you are talking about. It does need to work this way.
5) Then, and of course here is the catch... depending on the path which has been autopopulated in the path field, the tab named "Photos" is to display the iamges in the folder related to the selected record in the combo box.
 
Whoa....Sorry about that Steve. I've been a little busy.

As mentioned earlier, what you want to do with your particular section of Database can be accomplished in a number of ways. Since your requirements are so minimal you will find that the simple function applied to your Sample DB (attached with this post) carries out the task needed. The Code added is fully commented.

The Sample DB requires the filling of only six Image controls but what if there are 300 images to display?

If there is anyone interested I can also provide a sample of how to Dynamically create a Form with Image Controls and page through those Images.

.
 

Attachments

Incredible! Now, one more thing... what if I want select an image that has been loaded and when I click on it, have it enlarge on the screen? Can this be done?
 
Take a closer look my friend.....It's already there. :)

Just double click on any Image. A mouse-over Tip should pop up if the mouse is over any Image informing you of this.

If you look in the Forms section of the Database Window you should see a Form in there conveniently named.....ZoomForm.

.
 
Sorry I missed that. Excellent. Thank you so much for the help!
 
I have one more question... once the image have appeared on the form, how do I make them print on a report? I can't seem to make it work.

--Steve
 
Well Steve....it's a simple matter of copying the code we have in the Data Entry Form to display the Images into the OnFormat event within the Details Section of the Report Form with some slight modification due the difference in a couple of Control Names.

Yet again....I have attached your DB sample with a Report (Lots Report) added to demonstrate this. I also added a couple of Command buttons on the frmTest Form to carry out two different Report scenarios. One button is for displaying a Report on the Current Record and the other button is for displaying a Report on all Table records. The buttons are captioned accordingly.

Now...because the code used in both the Data Entry Form (frmTest) and the Report (Lots Report) is very much the identical thing, the proper way to apply this code so as to save on Database development size is to place the code into a Public (or Global) Function. That way a single line of code in both the Form and the Report will do the same thing. I'll leave that up to you. Look into it, research it....and understand it.

Turn the Code into a single Function and call that Function from both your frmTest Form and the Lots Report Report Form. By doing this you will learn more than you think.

.
 

Attachments

Users who are viewing this thread

Back
Top Bottom