Showing posts with label staff photos. Show all posts
Showing posts with label staff photos. Show all posts

Friday, 8 July 2011

Staff Photos - Use Access to change file names

I've got a nice little Access Database which holds a table of staff members, and another linking the staff to a photo file location. I then use a query to find members of a specific department with a photo and make a tiled report i.e. a staff board with names and job titles.

I've recently been asked to make the staff photos available for everyone, but the problem is they would not want to use the database in its present state (it doesn't look too pretty) and all the photos are still sorted in the folders corresponding to the photo-shoot date and still have their original file name. The question has come up - Can I get Access to rename the photos to say the staff name?

Well, I've done a bit of research (a google search) and it looks like to use access I'd have to do a bit of programming!! But there is this ingenious solution. Basically:

  1. Export a excel file of staff name and picture file location
  2. open excel and format it so that you get each row to say "ren \Photoshoot1\DSC00342.jpg \ArtAndDesign\StephenBleach.jpg"
  3. Then you can make a *.BAT file with a whole list of these commands and "bobs your uncle" you have renamed all the files and it'll only have taken about 30 mins. 
You can even adapt it to put them in directories according to Department! Genius!

But, rather then doing all this, I'd rather the college had a better system (i.e. not me) of gathering and sorting staff photos using some centralised system which everyone can take advantage of.

Tuesday, 6 July 2010

Putting photos in access records

So, I'm doing the staff photo boards for the whole college, and being as it is so large I'm going to be efficient and use a database. The first step of creating a database and putting all people in it, with the time and date of every photo taken down, so we know which photo is for which person.

Embedding the photos is not practical because apparently it converts them to bmp files which takes up a lot of disk space. So linking is the way to go. It means I'll have to have a folder for each photo shoot, which is always next to the database.

I found a nice little article which looks very simples. http://bytes.com/topic/access/answers/189710-linked-pictures. Basically, drag the photo into the field, then if you want to display it in a form you put:

on your form, create an Image object, and in Form_Current() place something like: Me![ImageFrame].Picture = Me![fImagePath]

2 hours later....

Tried this on a test database and it was a success. Wasn't quite sure what he meant by "image object" or "Form_Current" and the rest of it, so with a little bit of trial and error I succeeded! So here's what to do:

  1. Make a text field in the table where you put the location of the picture - i.e. c:\pictures\my picture.jpg
  2. Next make a report based on the table. I used the wizard, added the fields I wanted and went into design view.
  3. In the Detail section (middle bit) is where the data gets displayed. Along with the description, I put an "Image Box" found in the Controls section in the toolbars.
  4. It will want you to specify an image, just click "cancel"
  5. Click on the image container and on the right, you want to edit the "Control Source"
  6. I think I just selected the field with the photo location data in. Although I do remember putting:
    1. Me![ImageFrame].Picture = Me![Photo Location] - but I'm not entirely sure? Photo Location was the field I created in the table

Just got to work out how to tile it horizontally and vertically on a page.

Also, by default it "zooms" the image, so that it fits inside the box (no stretching). If you click on the image and set the format "Size Mode" to clip, it crops the image!! Yes!       - No!, on second thoughts it puts the image up at the size the image specifies if you go on zoom and crops almost all the large images. So I put it on zoom and put no border and seethrough background. Just have to make sure all the images are the same size.