Avatar of SteveL13
SteveL13
Flag for United States of America asked on

Trying to get a signature scanned file to appear on a form

I have a form that has a image block on it.  I'm trying to get a scanned signature to appear in the field with this oncurrent event of the form but it isn't working.  What am I doing wrong?

Me.imageMechEmployeeSig = DLookup("[SignatureScan]", "tblEmployees", "[EmployeeID] = " & Me.cboMech)

In the table, tblEmployees the field SignatureScan is an attachment field.
Microsoft Access

Avatar of undefined
Last Comment
SteveL13

8/22/2022 - Mon
Joe Howard

Try:
Me.imageMechEmployeeSig.Picture = DLookup("[SignatureScan]", "tblEmployees", "[EmployeeID] = " & Me.cboMech)

Open in new window

SteveL13

ASKER
Didn't work. I get an error ---  Object doesn't support this property or method.
Joe Howard

What kind of control is imageMechEmployeeSig?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SteveL13

ASKER
A bound image frame.
Joe Howard

Try using an Unbound Image Control.
SteveL13

ASKER
Getting close.  The form is a continuous form and the image does appear but now it appears in that field on all of the records?????
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Joe Howard

Why don't you just use a bound control. No need for code to load the picture at all.
SteveL13

ASKER
Because then I get back to... I get an error ---  Object doesn't support this property or method.
Joe Howard

When you use an Image Control?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
SteveL13

ASKER
Yes.
Joe Howard

SteveL13

ASKER
I appreciate the info but I really want to use the attachment filed option in this case.  I just can't figure out why the image is repeating on all records in the continuous form.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Joe Howard

You can't. This is a built in limitation in Access, the image control cannot be bound to a field in a continuous form, this is to prevent crashing in event of a large table.
SteveL13

ASKER
So then could I somehow make it an unbound control and just have it be populated with an afterupdate event of the combobox?  cboMech is the combobox.

Me.imageMechEmployeeSig.Picture = DLookup("[SignatureScan]", "tblEmployees", "[EmployeeID] = " & Me.cboMech)
Joe Howard

Yes, but then you will get the same image for all the records.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
SteveL13

ASKER
I guess I don't understand why this is any different than any other afterupdate event of a combobox.
IrogSinta

You don't need to use any code for this.  You just need to use a bound control.  The problem is you are using the wrong control for this.  You need to use the Attachment control.  The icon for this looks like a paperclip.  Once you add that control to your form, you just need to change the ControlSource to point to your attachment field.

Another way to do this is to click on Add Existing Fields and drag the whole attachment field group onto your form.

Ron
John Tsioumpris

Let me understand something
you have a continuous form and you want when you change the value of the combobox to have a unbound picture control to show you a specific picture...
Can you share a screenshot to see if i am missing something
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SteveL13

ASKER
Attached is a snapshot of just the part of the continuous form I am concerned with.  When the user selects a record from the combobox, two things need to happen...

1) His/her employee number is to populate the upper right-hand corner text box.  This is already working perfectly.

2) Also, after selecting a record in the same combobox, the employee's signature is to appear in the lower "picture box".

The signature file exists in a table named tblEmployees in an attachment field named "SignatureScan".

Combobox Example
Anders Ebro (Microsoft MVP)

I made this sample for you. It gets the information into the continues form by the use of a left join to the primary table. (See the recordsource for the form).

As far as I can see it satisfies your requirement of having the signature in a attachment field, and being able to show it in a continuous form.

AND its a no.code solution.

EDIT: Included a screenshotExample PictureTestGetImage.zip
SteveL13

ASKER
Anders, For some reason I cannot get my form to work like you did.  Please see the attached.  Select John Doe in the 1st combo box.  I do not know why the signature is not populated the signature field under the combo box.
Example.accdb
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Anders Ebro (Microsoft MVP)

Maybe its just because I am on my phone now, but the attachment reads as being 0 bytes?
SteveL13

ASKER
I don't even know where you see the attachment size.  Sorry.  There is an attachment in the employee table.
Anders Ebro (Microsoft MVP)

I mean the attachment you added to your post here :)
Its empty.

Maybe try zipping the file first?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SteveL13

ASKER
Anders,  New files attached including the signature file.  Please select "Alfred Moore" from the combo box.  His signature should then appear in the field below the combo box.  

Hope you can make this work.  I'm sure lost.
Example.accdb
Alfred-Moore.jpg
ASKER CERTIFIED SOLUTION
Anders Ebro (Microsoft MVP)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SteveL13

ASKER
Thank you very much.  Works perfectly.