Results 1 to 6 of 6

Thread: [RESOLVED] MS Access database - Input an image

  1. #1

    Thread Starter
    Junior Member OllieVB's Avatar
    Join Date
    Jan 2006
    Location
    England, UK
    Posts
    24

    Resolved [RESOLVED] MS Access database - Input an image

    Hi,

    I've created a database that stores details for a car club. It's been in use for a while and I thought I would try out some extras. The main thing I would like to add is the facility to include a picture of each member's car in their records. How do I create an image box where the image can be selected by the user and it's path stored in their record for future display, bearing in mind the user has no access to the code?
    Ollie
    Mess with the bull... You get the horns!
    ... Windows XP Home SP2
    ... Visual Basic 6 Professional Edition
    ... Office 2003 SP2 Professional Edition

    I will always leave a good response to helpful postings... They are a lifeline!

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: MS Access database - Input an image

    Do you want the user to have the ability to upload a picture of their specific car to the database or do you want them to select an image from a set of images that you already have?
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: MS Access database - Input an image

    You will need to use an Image control to display the picture. Then link it to your tables field for it. The field should be an OLE Object type.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Junior Member OllieVB's Avatar
    Join Date
    Jan 2006
    Location
    England, UK
    Posts
    24

    Re: MS Access database - Input an image

    Firstly, the idea is to be able to go into the member's record, click on the picture space, select an image that's already on the PC using a file selector dialog box (jpg files only) and have the picture come up in the box. At this stage, I'm not bothered about scaling. Also, I'm not sure if it's better to have the image linked or embedded.

    Forgot to mention... I have already set up an OLE Object field (called 'oleImage') and it's already on the record form. Just need to know what to do with it!
    Last edited by OllieVB; Jan 25th, 2006 at 05:03 AM.
    Ollie
    Mess with the bull... You get the horns!
    ... Windows XP Home SP2
    ... Visual Basic 6 Professional Edition
    ... Office 2003 SP2 Professional Edition

    I will always leave a good response to helpful postings... They are a lifeline!

  5. #5
    New Member
    Join Date
    Jan 2006
    Posts
    13

    Re: MS Access database - Input an image

    I tried a couple of ways to get a picture off of the HDD and insert it into a record. I couldnt figure out how to do that. What I ended up doing is leaving the field on the form and just letting the user copy/past the desired picture directly into the field.

    I was never able to find a way to use the INSERT or UPDATE statement to get a file from the disk and put it in a table. At one point I tried reading the picture file itself, but the file headers differed too much from one compression to another to work out for me in the time alotted.

    Edit: You might try a series of macros that copy/paste into a selected record.

    Couple of pointers I have for this task: Make sure that you take precautions on file size. Picutes can be unnecessairly large, and moving those pictures around will bloat your database.

    Since your pictures are going to be dynamically updated via some user operation, you'll be linking them.

  6. #6

    Thread Starter
    Junior Member OllieVB's Avatar
    Join Date
    Jan 2006
    Location
    England, UK
    Posts
    24

    Re: MS Access database - Input an image

    Found another way to handle it. As I didn't need to embed the images, I created a blank image box on the record form and had a hidden field holding the path to the image required. When the image is clicked, a common dialog box appears that allows this path to be changed. Whenever the form is loaded or altered, it checks to see if the path is set and if so alters the property of the image. It works a treat!
    Thanks for the help anyway guys!
    Ollie
    Mess with the bull... You get the horns!
    ... Windows XP Home SP2
    ... Visual Basic 6 Professional Edition
    ... Office 2003 SP2 Professional Edition

    I will always leave a good response to helpful postings... They are a lifeline!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width