Image Capture in an Access Form

Posted on 2005-04-20
Last Modified: 2008-02-01
I am trying to consolidate all the little applications my company has acquired over the years that deal with employee information. I have managed to tie time tracking, training, building access, and personnel records to a central database but there is still one separate application that is causing me trouble.

We have an off-the-shelf program that takes the employees photo and generates an ID badge. The badge is coded for building access. The problem with this program is that the database is not linkable in any way helpful to me.

I have all the needed data in the central database, including a field named “photo” that contains the name of the jpg bitmap for each person. I have found a few badge making applications that let me print the badge using my database as a reference. One problem remains:

I have no clean way to photograph the employee and save the bit map where it belongs. I am looking for something that would keep this whole process flowing easily for our HR department so they don’t have to become computer experts to add a picture. What I envision is something like an Access form that shows the live USB video feed on the left and a resulting still on the right that occurs when they click a button. If the picture is acceptable they click another button and the bitmap is saved in the right location with the right file name. This form could just become part of the employee information entry procedure. A separate program that does that job would work as well. I could call it from a form.

Sorry for the long winded explanation. I figured the best way to get results is to make the whys and where clear to everyone. I am open to any and all suggestion that accomplish the above.

Points go to the person who points me in a direction that leads to solving my problem. If anyone has the actual solution they can offer, the points will be doubled.

Thank you;
Question by:RandyTippetts
    LVL 36

    Accepted Solution

    LVL 44

    Expert Comment

    save the Picture file ANYWHERE on DISK (do not, repeat NOT, store the JPG files in the database itself).  What you save in the employees record in the database is the PATH to the JPG file, not the file itself.

    You can then load the JPG into an Image control on a form, using the path to the file, as retrieved from the employee record.

    If you need more explanation, just ask.

    LVL 1

    Author Comment


    Saw that before posting. It looked a little over my head. I take a closer look at the links.

    Arthur Wood;

    I have that part nailed. The photo field just contains the name of the bitmap. The form works fine on people with current pictures. I am trying to find a better way to add new pictures or change existing.
    LVL 36

    Expert Comment

    this is really quite simple

    Get the file from shrinkwrapvb
    unzip file

    open a new form

    goto the code page, tools > references , register the ocx's (the rest of the files in the zip are inrelevant unless you have VB)

    place a vbVidC60.ezVidCap Control on your form (from the More Controls button on your tool bar)

    Name the control Vid

    create a button

    Private Sub Capture_Click()
    Me.Vid.SaveDIB "C:\test.dib"
    End Sub

    then write some code to insert

    strSQl = "Insert Into MyTable (ID, CapPath), values (me.SomeID, "C:\test.dib")
    execute...blah blah

    obviously you'll want to think about naming of the file

    you could have multicapture and autorename
    Public FilePad
    Private Sub Capture_Click()
    If IsNull(filePad) Then
       filePad = 1
    End If
    Me.Vid.SaveDIB "C:\Pic_" & filePad & ".dib"
    filePad = filePad + 1
    End Sub

    or some input

    Private Sub Capture_Click()

    CapName = inputbox ("Please Enter CapName")

    Me.Vid.SaveDIB "C:\ & CapName & ".dib"


    and there's a lot more you can do with the ocx like set input source, output, capture audio and more...

    but that's the basics...

    LVL 1

    Author Comment

    Thanks all;

    SidFishes had me look deeper into a prior post. The links in that post did start me in the right direction. I haven't gotten it seamless yet but I am well on the way to a useable workaround. I will play with your codes suggestions "SidFishes" when I have gotten them online.

    Thanks again.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now