Add Employee's Image to the Form (Outside Access DB) (1 Viewer)

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
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..
 

Attachments

  • PlatForms.zip
    42.2 KB · Views: 369

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:03
Joined
May 7, 2009
Messages
19,169
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.
 

Attachments

  • PlatForms.zip
    55.9 KB · Views: 209

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
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"
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:03
Joined
May 7, 2009
Messages
19,169
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)
 

Attachments

  • PlatForm_MasterCard.accdb
    832 KB · Views: 459

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
The DB in D:\PlatForms\
Also D drive and subfolders are trusted locations.
Attached error screenshot.
 

Attachments

  • PlatForm-error.jpg
    PlatForm-error.jpg
    38.9 KB · Views: 446

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:03
Joined
May 7, 2009
Messages
19,169
where are you copying your pictures? from network drive or local?
 

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
From Local source.

Btw; For your inquiry Ill ask our HR Dep.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:03
Joined
May 7, 2009
Messages
19,169
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).
 

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
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?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:03
Joined
May 7, 2009
Messages
19,169
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.
 

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
Thanks for explanations...
Could you please tell me the benefit of selecting FOLDER "Do you wish to pick a File or a Folder?"?
 

MasterCard

New member
Local time
Today, 12:03
Joined
Jul 28, 2016
Messages
9
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?
 

wasim

Registered User.
Local time
Today, 02:03
Joined
Jun 10, 2016
Messages
19
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 ?:banghead:
 

Users who are viewing this thread

Top Bottom