taking pictures and adding them to current record

T

taco

Hi Everyone;

I have an Employee Database created on Access 2007. What I would like to do
now is, when I'm creating a new record, user will click on the button and
will take the picture of employee with an external application (webcam
software). And that picture should be added to the current record.

After that, when the record is completed, user will click on another button
in order to print employee ID card.

Thanks a lot in advance for all the help I can get.

Best Regards;
 
D

dymondjack

I think one of the issues you're going to run into here is waiting for the
webcam software to do its thing before closing the record. Generally you are
best off if you keep the record 'edit' in as short of state as possible.

I'm not sure how (or if) access would communicate with the webcame software.
You could easily enough start the cam software using the Shell function from
a command button in access, and getting the file from a saved location after
is not too big of a deal either, but everything in between (the functions of
the webcam software that captures & stores the image) will be very difficult,
if not impossible to manage from access.

I would suggest one of two approaches here, depending on how you prefer to
work with data. If you don't have an issue saving an employee record without
the picture initially attached, provide the user with a button to retreive
the file after the cam software has saved it to a standarized location (with
a standardized name, so you can program access to find it).

Or, if you do not want the record part of your main dataset until the
picture is attached, utilize a table to hold temporary partially completed
records until the picture is finally attached, and then move that record into
your main dataset.

As far as how to start the webcam software, see the ShellExecute API from
mvps.org:

http://www.mvps.org/access/api/api0018.htm

This works like a charm for firing up external applications.

To store the picture, I would advise saving the filename & path in your
table rather than the image itself. This will keep sizing way down. Don't
use the hyperlink datatype, just regular text, and store the path to the
picture in the record. Then, you can have the user open the picture to view
it (again using the ShellExecute API), or you can link the filepath via an
image control directly into the report.

Its a little bit of work to set this up, but in the broad scope of things
shouldn't be too bad. Just keep in mind that access will likely have no
control over what the webcam software does, so don't depend on it. You will
probably have to manually set up the webcame software to save the file with a
name that access can find.

The Dir() function and FileCopy function will probably be common to a task
like this, so you may want to read up on those.

hth

--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 
T

taco

Thanks a lot for your time and all these information. They will be very
useful indeed. Appreciate it.
 
R

RJamis

Greetings,
I'm using Access 2003.
Have created small DB with the following fields:
InventoryID - AutoNumber
Stock # - Text Field (Primary Key)
Description - Text
Bin Location - Text
Image - OLE Object

Created Form Using Wizard.
While inputting data, I right click on the OLE Object Control then select
Insert Object.
On Dialog box, I check the Creat from file radio button.
I browse to the JPG file then Dbl Click.
The Picture appears in control but also has file name in the control.

Have changed various properties with no success.
How can I get rid of the file name?

Thanks...
 
D

dymondjack

How can I get rid of the file name?

I've never used an OLE Object so I'm not sure.

If you want to try a different approach and go with someone a saved filepath
and an image control on a form/report, I can help with that, but I really
haven't the slightest idea of what the pros/cons would be. I could name the
reasons I like the image control/filepath method, but I am in no way
qualified to compare that to an OLE.

--
Jack Leach
www.tristatemachine.com

- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
 
R

RJamis

After mulling it over & over & over in my mind, I came across the image
control and path method. I had been waiting for a reply for someone and
hadn't gotten one, but it appears as though i was right on since that is the
method you were recommending. It turns out that it works out really well.
I'm curious to know how you would have done it.

I created a field with the name of the image I wanted to display and set a
variable as a string to that field name.

Option Compare Database
------------------------------------------------------------------------------------------------
Dim X As String
X = ImagePath.Value

In Command Buttons Click Procedure that moves to the previous and next record

Image.Picture = X
Thank you for your response. I may have some further questions later.
 
R

RJamis

Well, First off thanks for the Help. It has been very informative.
I didn't try the OnCurrent Procedure, but it makes sence.
Second, do you know if bar code scanners can be used to deduct from data in
Access, (ie Inventory DB's)
Thanks.
 
D

dymondjack

do you know if bar code scanners can be used to deduct from data in
Access, (ie Inventory DB's)

Yes, they can, although the exact procedures I'm not sure about. AFIAK
scanning from a barcode passes a String relative to the barcode, and I would
assume vise-versa. The code I assume you would do in vba, integrated with
the scanner software, though I'm not positive.

I know it can be done, I've seen some related posts here, and know of a few
companies that use access and barcodes, but I can't offer any details as I've
never set up that type of functionality.

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top