Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-21-2016, 11:09 PM   #1
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Add Employee's Image to the Form (Outside Access DB)

Hi all, I am planning to store Employee details at Access DB (My Access version 2013 English 32bit). I have done with tables and Forms just left adding image of the employee but not inside the Access DB, I want it in the same Access DB subfolder (D:\PlatForms\Attachements\EmployeeFoto\).
Access DB in (D:\PlatForms\PlatForm_MasterCard.accdb)

In the form: frm_Employee I add command buttons (add and remove) and Image frame also.

So want from Access on current record to do below;
1-When I click add image button, add image window appear then I select the desired image then click ok to save it at (D:\PlatForms\Attachements\EmployeeFoto\1163 ANTHONY MURPHY) folder.
2-When I click Remove image, access will remove the image file from that folder.



Note:1163 is the ID of Anthony Murphy.
So the save format will be "ID FirstName LastName"
Access DB attached.


Can anyone help me on this.
Thanks a lot in advanced..
Attached Files
File Type: zip PlatForms.zip (42.2 KB, 15 views)

MasterCard is offline   Reply With Quote
Old 08-22-2016, 03:15 AM   #2
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,568
Thanks: 68
Thanked 2,744 Times in 2,629 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Add Employee's Image to the Form (Outside Access DB)

try this my friend:

edit:

maybe you need a material controller for your company. i am currently working as such here in shuqaiq steam power plant, al-darb jizan.
Attached Files
File Type: zip PlatForms.zip (55.9 KB, 21 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
MasterCard (08-22-2016)
Old 08-22-2016, 03:27 AM   #3
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

Quote:
Originally Posted by arnelgp View Post
try this my friend:

edit:

maybe you need a material controller for your company. i am currently working as such here in shuqaiq steam power plant, al-darb jizan.
Thank you very much for your efforts..

I check it and it gives error, when I press debug it shows: "FileCopy s, strFoto"

MasterCard is offline   Reply With Quote
Old 08-22-2016, 03:50 AM   #4
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,568
Thanks: 68
Thanked 2,744 Times in 2,629 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Add Employee's Image to the Form (Outside Access DB)

strange, i don't encounter error.
make sure your db is in Trusted location and you have right on that drive (don't use the root of C:\ drive, put your db on a folder on C:\ or D:\ then add that folder and subfolder into Trusted Location)
Attached Files
File Type: accdb PlatForm_MasterCard.accdb (832.0 KB, 21 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-22-2016, 03:58 AM   #5
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

The DB in D:\PlatForms\
Also D drive and subfolders are trusted locations.
Attached error screenshot.
Attached Images
File Type: jpg PlatForm-error.jpg (38.9 KB, 37 views)
MasterCard is offline   Reply With Quote
Old 08-22-2016, 04:03 AM   #6
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,568
Thanks: 68
Thanked 2,744 Times in 2,629 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Add Employee's Image to the Form (Outside Access DB)

where are you copying your pictures? from network drive or local?
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-22-2016, 04:12 AM   #7
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

From Local source.

Btw; For your inquiry Ill ask our HR Dep.

MasterCard is offline   Reply With Quote
Old 08-22-2016, 04:28 AM   #8
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,568
Thanks: 68
Thanked 2,744 Times in 2,629 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Add Employee's Image to the Form (Outside Access DB)

did you click the Enable Content when Security Warning shows up. if so then edit your form.
go to vbe. Click on any portion on this line: Private Sub cbAddImage_Click(), then press F9 (debug mode). run your form and click the add image command button. while on debug mode press F8 (to step). when you reached the line when variable "s" has its value, try evaluating what is the value of s on immediate window:

?s

post the value of s.

==
tnx, tomorrow I'll be transferring to another project in Jizan (Aramco Proj).
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-22-2016, 04:35 AM   #9
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

Thanks for your advices. The problem was the source folder contained arabic letters thats why Access DB cant recognize it. I rename it to English characters and it works.

Btw, other sample databases are used path folder in the tables, Why they using it like that do you know the reason or what is the difference?
MasterCard is offline   Reply With Quote
Old 08-22-2016, 04:52 AM   #10
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,568
Thanks: 68
Thanked 2,744 Times in 2,629 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Add Employee's Image to the Form (Outside Access DB)

the advantage of saving the path to a field is when say you want to change the path of your pictures, you do not need to open and edit every form that has reference to the path of your pictures, just to edit it. you can just edit the path on the table and use DLookup() function in your code to get the path. this method is more flexible and you don't need to code your db everytime the path changes.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 08-22-2016, 06:22 AM   #11
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

Thanks for explanations...
Could you please tell me the benefit of selecting FOLDER "Do you wish to pick a File or a Folder?"?
MasterCard is offline   Reply With Quote
Old 08-24-2016, 12:34 AM   #12
MasterCard
Newly Registered User
 
Join Date: Jul 2016
Location: Currently @Riyadh
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
MasterCard is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

Brother, I am planning to put this DB in local network after dividing it to FE and BE. So which method will be much helpful and best for that?
MasterCard is offline   Reply With Quote
Old 09-02-2016, 09:16 PM   #13
wasim
Newly Registered User
 
Join Date: Jun 2016
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
wasim is on a distinguished road
Re: Add Employee's Image to the Form (Outside Access DB)

Quote:
Originally Posted by arnelgp View Post
the advantage of saving the path to a field is when say you want to change the path of your pictures, you do not need to open and edit every form that has reference to the path of your pictures, just to edit it. you can just edit the path on the table and use DLookup() function in your code to get the path. this method is more flexible and you don't need to code your db everytime the path changes.

Dear arnelgp,

If we need to copy the file to server /LAN what will be the destination code ?

wasim is offline   Reply With Quote
Reply

Tags
add image , add image to folder , image , store image to folder

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add an image to SQL db, and reference it in an access form? GBalcom SQL Server 2 10-31-2014 08:05 AM
Access form Image to word..Help needed chrisoreillyuk General 0 01-12-2007 04:41 AM
click image hyperlink in form to load image to form 99shassan Forms 1 06-16-2006 04:48 AM
how to enter image in access form jensonchandy General 6 01-27-2005 05:34 AM




All times are GMT -8. The time now is 12:36 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World