|
||||||
|
|
Images By Richard Rost Display Images Without Storing in the Database! In this video, I'll show you how to display images in your Microsoft Access forms and reports without storing them in your database. Images (or any external files for that matter) can really bloat your database, making it big and slow. Storing the files in an external folder and tracking the location of that file is a much more efficient way to handle images with Microsoft Access. Haruki from Kawasaki, Japan (a Platinum Member) asks: I would like to be able to print out employee name badges with their name, the company logo, and their picture. What's the best way to do this in Microsoft Access? MembersMembers will see how to use a little VBA code to make a button that we can click on and browse for the filename. This way you don't have to type in or copy/paste the path and file for the picture. Just click, select, done.
Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!
Courses
Links
Updates
IntroIn this video, I'll show you how to display images in your Microsoft Access forms and reports without storing the actual files in your database. We'll set up a customer profile form with a photo, create name badges displaying the customer's name, profile picture, and your company logo, and discuss the best practices for handling images efficiently in Access by storing the image path instead of using attachments or OLE objects. You'll see how to link and display pictures on forms and reports, along with tips on setting up your tables and controls for this method.TranscriptWelcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost. In today's video, I'm going to show you how to display images and pictures in your Microsoft Access Forms and Reports without storing them in the database.We'll put a profile picture on the customer's form. Then we'll be able to generate some name tags with the customer's name, profile picture, and our company logo. Today's question comes from Haruki in Kawasaki, Japan, one of my platinum members. Haruki asks, I would like to be able to print out employee name badges with their name, the company logo, and their picture. What's the best way to do this in Microsoft Access? Well, Haruki, there are tons of different ways you can do this. I'm going to show you my preferred way. Now, there are a couple of different ways to handle images in Microsoft Access. Back in the old days, all we had were OLE objects. It's called object linking and embedding. You'd see that, for example, if you wanted to copy and paste an image from Microsoft Word over into Excel. You'd copy it and then you'd paste it. You could paste a link to it. If the original changed, then it would update all your documents and all your Excel spreadsheets and stuff with the updated image. You could either store the image in the document or you could just pass a reference to it. It wasn't stored. But even doing that, there was still a lot of data that was stored in the document to process that OLE image. So they're not very efficient. That's old technology. Access keeps that technology for backward compatibility, so you could still use it if you want to. But personally, I don't like it. Then, somewhere around 2007, I think, Microsoft added something called an attachment field to Access Tables. This allowed you to actually attach documents and pictures and all kinds of stuff into your tables and they'd be stored in the Microsoft Access file, much like you can store a picture in an email as an attachment and send it to someone. The problem with storing images and other documents inside of your Access database is your database gets big, it gets slow, it gets bloated, and it's not very efficient. I've done some tests on databases with OLE objects and attachments stored in them, and it's not pretty. It's not the best way to handle dealing with images and other file types. So the best way to handle images is to store the path and file name of the image where it's located and what its name is in a text field. Then we'll use the image control to display it both in our forms and our reports. That's what I'm going to show you how to do right now. Here I am in my TechHelp Free template. This is a free download, by the way. You can go grab this on my website if you want to. I'll put a link down below in the description of the video. You can go find it, download it, or put this in your own database if you prefer. Now, Haruki wants to do employee name badges. We'll do the same thing with customers. I already have a customer form set up. Here's me. Let's say I want to put a little profile picture right here. I want to display it on the customer form and we'll make a little report for it too. The first thing I need to do is put a field in my table to store the path and file name of the picture itself. Now, here on my Windows desktop, I've got a folder that I created called images. Let's open that up. In there, I've got two pictures of me. Hi me. Hi, how you doing? Rick one and Rick two.jpeg. If you click right here in the address bar, you'll see that's the full path to where your images are. That's where I've got mine. So I'm going to copy that to the clipboard. Control-C, copy that. Now I just have to paste that and then put Rick one or Rick two.jpeg in my table. One note: if you're working on a network, if you're sharing your database with other people, you have to make sure you use a folder location that is the same for everybody. Like on my network, I've got a server Z drive. It's mapped to Z for everybody. You could go server and then a folder name or a drive letter, but it's got to be the same for everybody if you're sharing your database. Back in the database, let's go to our customer table, design view. Let's add a field down here. I'll call this profile picture. Don't use the word picture alone. Picture is a reserved word in Access. Avoid using just the word picture. Short text is fine. 85 characters should be plenty long for your path. Save that. Close it down. Let's go back to the customer form, design. Let's make some room here. I'm going to just take this stuff right here and just slide it down underneath. So we have some extra room here. Let's make this guy a little shorter, so I've got room for the picture to go right there. But first, let's go to add existing fields. Find that profile picture field that we added to the table. Click and drag and drop it right there because we're going to have to have this on the form so we can change it. So we can put in a new picture. I'm going to slide this over here like that. This can just say picture. This is the label. That's okay. Maybe for class purposes, let's slide this over here. Make this a little smaller. Put this guy right up next to it because this can be pretty long. Now let's put an image control right here. Go up to your controls. Now there are a bunch of different things in here. There are the OLE objects, the unbound object frame, the bound object frame. I cover these in my different classes. Access Beginner 6, I believe I covered this stuff. But what you're looking for is that guy right there, the image control. Very important to use this one: image control. Click on that. Drop a box right here where you want it to go. The insert picture dialog box appears. We don't want to just insert one picture. We're going to bind this control to a field in the table. So I'm going to hit cancel. Now I've got an empty image control sitting right here. Open up its properties. Here is the property sheet. Right now it's called image32. Let's call this profile picture image. Because this guy is already called profile picture, we can't use that name. That's profile picture, so this is now profile picture image. But we're going to bind it to the profile picture field. You can have two controls that are bound to the same field. So this and this are both going to get their data from that profile picture field in the table. This will display it as text. This will display the actual picture. Now all we have to do is put some data in there. Close this, save it, close it, open up the customer form. Now we've got to put some stuff in here. Remember that path and file name. So I'm going to press Control-V to paste because I put that in my clipboard earlier. C:\\Users\\Richard\\Desktop\\images. Use a shorter folder if you can, like C:\\pictures or your Z drive if you have a network. Now, backslash Rick1.jpeg and then there it is. Let's go to the next one. Let's go to the next record here. I'll paste and then Rick2.jpeg. Ready? Click. There we go. See, and if you move between them, there they are. It's displaying the picture found at this location without storing it in your database. You're not making your database big and bloated by storing pictures in it. If you want to change these pictures, you can do so outside the database. You can replace that file with something else. I do have to admit, I cheated a little bit because what I did was I hit Shift Tab instead of Tab. Because if you go to a new one here, if I paste, if I go Rick1.jpeg and hit Tab, you don't see anything happen because this came in at the end of the tab order. So as soon as you hit Tab, it goes to the next record. It inserts the picture, but you don't see anything happen. The first time I ran through this when I was practicing earlier, I realized I can't let viewers see that the first time through. So now I'm showing you what I did. To fix that, just put this properly in the tab order. Let's say we have orders down here and contacts. You can put these fields back wherever you want them, but just put the profile picture in front of these guys in the tab order. Remember the tab order? If you're not familiar with the tab order, I have videos on tab order. I'll put links down below if you haven't seen this yet. Just scroll down here and find profile picture. Slide it up before the contact button, for example, so it's not the last thing in the tab order. Hit OK, save changes. Now, if I go to a new record, I can go paste, and then Rick1.jpeg, and when I hit Tab, I'm sitting on the Contacts button, and you see that actually happen. Now, how do we make name badges out of this? Well, we do it pretty much the same way we did with the form; just do it in a report. So let's close this. Haruki wants name badges. Click on customer T, click on labels. Name badges are pretty much labels; you just kind of format it a little bit bigger. Find a label that matches the size you want and use that for your name badge. I did a video a while ago printing on Dymo labels. I'll put a link to that down below if you want to. Dymo labels also have a name badge-sized label you can use. I'm going to pick sheet fed. Turn off custom label sizes. Go down to Avery. I usually use Avery labels. Then just find something that fits about what your name badge is. Let's say this one here. Let's say that's three across, two inches by two inches. That's good. That's a good size for a name badge label. If you want to put text in here, pick font size, font weight, all that stuff. Build your prototype label: first name, space, last name. That's good enough. If you've got a title in here, maybe. Next. If you want to sort it, set that up. Let's go to modify label design. There's the label it built for us. You could resize it, do whatever else you want with it. I've got videos on all that stuff. Now do the same thing you did before. Go up to the control box. Find the image control. Drop an image right here for the profile picture. Cancel this. Open up the properties. Go to control source, profile picture. Name it profile picture image. You can name this one profile picture if you want to, but it's good to stay consistent. Close this and open it up to see what it looks like. Come down here. Labels customer T. I would of course rename this to customer label R. Right click, go to print preview, and there we go. There's our mailing labels, our employee name badges. If you want to put the actual company logo on here, which is the same for everybody, go back to design view. Make this a little bit smaller so we have some room. Down here, we'll put another image. Grab that, drop it here. This time, when it asks you for the picture, give it the actual image file for your company logo. I just dropped one in my images folder to use. Hit OK. You can see it's now in the label. That's a static image. Now, that one won't change. This one will. Maybe you want to rearrange this a little bit. Let's put this over here on the side like the name. I am not an artist, but let's maybe format this to make it a little bit bigger. Let's see what this looks like. Save it, close it, right click, print preview. There we go. That's not too bad looking. There you go. There's your name badges. So that's how you put images in your reports and in your forms. Want to learn more? In the extended cut for members, I show you how to add a button that you can click on and browse for a file. That file will get put right in your picture field. This way, you don't have to copy and paste the path name or type in the file name or any of that stuff. You just browse for it. Here I am in the database. Click the browse button. Dialog box appears, pick the picture, hit OK, and there it goes. That's it, that's all you have to do. That is covered in the extended cut for members. Silver members and up get access to all of my extended cut videos, gold members get access to download the databases that I've built in these videos. I've also put some links down below to other courses and videos where I cover stuff dealing with images. Access Beginner 6 is image basics. That's just copying and pasting images into your database, which is OK if you've got a few images, a few small things. I wouldn't recommend doing that for lots of images, though, but it's simple and it works. Access Expert 4 goes more into working with images and reports. Access Expert 24 covers displaying images from a website. So if you have images on your web page that you want to display in your Access database and your forms and reports, you can do that as well. My Access Imaging Seminar covers all kinds of different stuff, pretty much anything you want to know about working with images in Access, including copying a file from a different location on your network and having it automatically copied to your central file repository wherever your server is. That's pretty cool stuff. Then my ABCD, my Access Business Contact Database Part 5, covers full document management. In addition to the picture stuff that we did today, it also covers working with PDF files, attaching Word documents, Excel spreadsheets, and keeping them in a central repository again, like I said, instead of embedding them inside your database. All kinds of stuff. I'll put links to all of this stuff down below in the description window. If you just want the browsing for a file part, all you have to do is become a silver member. Silver members get access to all my extended cut videos. How do you become a member? Click the join button below the video. After you click the join button, you'll see a list of all the different types of membership levels that are available. Silver members and up will get access to all of the extended cut TechHelp videos, live video and chat sessions, and more. Gold members get access to a download folder containing all the sample databases that I build in my TechHelp videos, plus my code vault, where I keep tons of different functions that I use. Platinum members get all the previous perks, plus access to my full beginner courses and some of my expert courses. These are the full-length courses found on my website and not just for Access. I also teach Word, Excel, Visual Basic, ASP, and lots more. These free TechHelp videos are going to keep coming. As long as you keep watching them, I'll keep making more. If you liked this video, please give me a thumbs up and feel free to post any comments that you have. I do read them all. Make sure you subscribe to my channel, which is completely free, and click the bell icon and select all to receive notifications when new videos are posted. Click on the show more link below the video to find additional resources and links. You'll see a list of other videos, additional information related to the current topic, free lessons, and lots more. YouTube no longer sends out email notifications when new videos are posted. If you'd like to get an email every time I post a new video, click on the link to join my mailing list. If you have not yet tried my free Access Level One course, check it out now. It covers all the basics of building databases with Access. It's over three hours long. You can find it on my website or on my YouTube channel. If you like Level One, Level Two is just $1. It's also free for all members of my YouTube channel at any level. Want to have your question answered in a video just like this one? Visit my TechHelp page and you can send me your question there. Click here to watch my free Access Beginner Level One course, more of my TechHelp videos, or to subscribe to my channel. Thanks for watching this video from AccessLearningZone.com. Thanks for watching. I'll see you next time. Bye. QuizQ1. What is Richard Rost's recommended method for displaying images in Microsoft Access forms and reports?A. Store images directly in OLE object fields B. Store images as attachments in tables C. Store the image path and file name in a text field, and display with an image control D. Embed images as macros in the forms and reports Q2. What is a major drawback to storing actual images inside an Access database? A. The images automatically get compressed and lose quality B. The database becomes large, slow, and inefficient C. Access cannot open files with images inside them D. The images are only accessible on the computer where they were stored Q3. Why is it important to use a folder location that is the same for everyone when referencing images in a shared network Access database? A. Access can only access the C drive by default B. Different paths for each user will cause broken image references C. Access automatically duplicates the images for each user D. Every user has a different version of Access Q4. When adding a field to the Customer table for storing the image reference, what type of field should be used? A. OLE Object B. Attachment C. Short Text D. Hyperlink Q5. Which control should you use on an Access form or report to display an image using a file path from a field? A. Bound object frame B. Unbound object frame C. Image control D. Rectangle control Q6. What should you avoid naming the image path field in your table? A. ProfilePicture B. CustomerImage C. Avatar D. Picture Q7. If the image control is not updating immediately when entering a new file name, what might be the cause? A. The image format is not compatible B. The tab order is not set correctly C. The database is in read-only mode D. The image control is not visible Q8. What is a benefit of displaying images using file paths rather than embedding them in the database? A. It increases database security B. Images can be easily updated outside the database C. Users do not need access to the image files D. It allows for automatic resizing of images Q9. When designing name badges as reports, what is suggested as a starting point? A. Always start with a blank report B. Use the Labels Wizard to select an appropriate label size C. Export the form as a PDF and print it D. Use the Attachment field for images Q10. For displaying a company logo that is the same on every badge, what is the correct approach? A. Use a separate table to store the logo for each record B. Use an image control with a static image inserted into the report C. Link to the logo URL on the company website D. Use a calculated field in the table Q11. If you want to allow users to browse for a file and automatically fill in the path, what feature does Richard mention is covered in the extended cut? A. Macro programming B. Text input validation C. A browse button with a file dialog D. Embedding the image directly Q12. To ensure consistent operation for all users on a network, which drive setup is recommended for image storage? A. Use each user's desktop folder B. Map a central network drive with the same letter for everyone C. Store images in the Access installation folder D. Use USB drives for portability Q13. Which membership level gives access to downloadable sample databases from Richard's TechHelp videos? A. Standard B. Silver C. Gold D. Platinum only Q14. Where can you find additional resources and related videos for the lesson presented? A. In the comments section B. In the description window below the YouTube video C. In the Access help files D. On the Microsoft Access startup screen Q15. Which course is specifically mentioned as covering the basics of copying and pasting images into Access? A. Access Imaging Seminar B. Access Beginner 6 C. Access Expert 4 D. ABCD Part 5 Answers: 1-C; 2-B; 3-B; 4-C; 5-C; 6-D; 7-B; 8-B; 9-B; 10-B; 11-C; 12-B; 13-C; 14-B; 15-B DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks. SummaryToday's video from Access Learning Zone covers how to display images and pictures in Microsoft Access forms and reports without actually storing the images in your database file.The scenario I'll show you is based on a question from Haruki in Japan, who wants to print out employee name badges that include their name, the company logo, and a picture. This is something many users ask about: how best to show images in Access? There are several approaches but I'll walk you through my preferred method. Historically, Access supported images through OLE objects, which stands for object linking and embedding. That method let you link to images or files, or even embed them in your database. However, OLE objects are inefficient and store a lot of extra data, which is not ideal. Microsoft later introduced attachment fields around Access 2007, so you could insert images and files directly into your tables (much like email attachments). Unfortunately, storing images inside your Access database, whether as OLE objects or attachments, creates huge, slow, and bloated files. Based on my experience and testing, having images stored directly inside your database is rarely the best idea for most applications. The preferred approach is to store only the file path and name of your image in a text field in your table. Then, use the image control to display the picture in your forms and reports. This keeps your database size small and flexible. I'll show you how to do exactly that. In my demonstration, I use the free TechHelp template, which you can download from my website. In Haruki's case, we're making name badges for employees, but I'm going to demonstrate with customer records. I already have a Customer form built and want to add a profile picture display. First, you need a text field in your table to store the picture's file path and name. On my desktop, I've created an 'images' folder with sample pictures. It's important to use a folder location that will be accessible by everyone who needs to use the database, especially if you're sharing it on a network. The drive letter and path should match for all users. Back in Access, I open my customer table in design view and add a new field called 'ProfilePicture' (avoiding the reserved word 'Picture'). I use the Short Text data type, which is more than enough to store any reasonable path and filename. On the Customer form, I make space to show both the profile picture and the text field. I add the new ProfilePicture field to the form so users can enter or change the image path as needed. Then, I insert an image control from the Controls toolbox. Access will prompt to insert a picture, but since we want this image to depend on what's in the ProfilePicture field, I cancel the prompt. I name the image control 'ProfilePictureImage' and set its control source to the new ProfilePicture field. Now, the control will display whatever image matches the file path provided in that text box. When entering data, you just paste or type the full path and file name to the image. The image then appears in the form. This approach avoids making your database file huge since the pictures are stored outside the database. You can also change those pictures independently, simply by replacing the image file on disk. I also talk about form usability, such as setting the tab order so fields are entered in the correct sequence. Setting the ProfilePicture field properly in the tab order keeps the form flow logical and ensures the image refreshes as you move to new records. For the next step, I demonstrate how to create name badges as reports. In Access, you can use the Labels wizard to make a report sized as a name badge. You select a label size that fits, format your report with the customer's first and last names, and add image controls for their picture. The steps are very similar to what we did in the form. For a company logo, add another image control to the report and set that to a static image since the logo is the same for everyone. Once set up, this method generates name badges that include each customer's name, their picture from the file path, and your company logo. For those interested in additional functionality, the Extended Cut for members demonstrates how to add a button to browse for a picture file, so users don't need to manually type or paste the path. Instead, they just click a button to select a file, and the database records the path automatically. Silver members (and above) can watch all the extended cut videos; gold members can download the sample databases built in these lessons. I have also linked to other relevant courses and videos on image handling in Access: - Beginner 6 covers the basics of images in Access - Expert 4 discusses using images in reports - Expert 24 explains displaying images from websites - The Imaging Seminar covers advanced image management, including central file storage - ABCD Part 5 goes deeper into full document management, supporting not just pictures but also PDFs and Office documents, stored centrally but not in the database file Becoming a member gives access to extended content, sample databases, and code samples. Membership levels include silver (extended videos), gold (database downloads and code vault), and platinum (all prior perks plus full beginner and some expert courses, not just for Access). If you found this lesson helpful, please give it a thumbs up and share your comments. Make sure to subscribe to my YouTube channel for free and enable notifications for new videos. If you want email notifications about new releases, you can sign up for the mailing list. Do not forget to check out my free Access Level One course, which covers all database basics and is over three hours long; you can find it on my website or YouTube channel. Level Two costs just a dollar or is included free with any membership. To have your question answered in a future video, visit my TechHelp page and submit your inquiry. A complete video tutorial with step-by-step instructions for everything discussed here is available on my website at the link below. Live long and prosper, my friends. Topic ListAdding a profile picture field to an Access table for image pathsBest practices for naming fields to avoid reserved words Storing image file paths instead of actual images in Access Creating an image folder and managing image files on disk Mapping shared network drives for multi-user image access Adding a text field for image paths in table design view Adding the image path field to an Access form Using the image control in Access forms for dynamic images Binding an image control to a text field for file paths Editing and arranging form controls for image display Setting and modifying form tab order for better usability Entering and updating file path data to display images Formatting forms to accommodate profile picture display Creating name badges using label reports in Access Selecting and configuring appropriate label size for badges Adding and binding an image control to Access reports Inserting static company logos into Access reports Arranging images and text in label report layouts Previewing and adjusting name badge reports with images |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||
| Keywords: TechHelp Access Attachments, OLE Objects, Embedded, Images, Pictures, Graphics, Profile Pictures, name badges, image control, path filename, shared network folder, repository, file picker, pick file, browse file, pickfile, filedialog PermaLink Images in Microsoft Access |