473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Attaching ID Photo to a form

I would like to create an employees database and I want to add a photo of employee on the form, how can I do it?
May 16 '07 #1
10 4877
Denburt
1,356 Expert 1GB
There are many samples of this sort in the Northwind database. Do a search on your PC I am pretty sure you have a copy then look for the employees form.
May 16 '07 #2
There are many samples of this sort in the Northwind database. Do a search on your PC I am pretty sure you have a copy then look for the employees form.
Thank you very much Denburt. Yes its there in the Northwind.mdb.
May 17 '07 #3
Denburt
1,356 Expert 1GB
Great feel free to ask any questions.
May 17 '07 #4
Great feel free to ask any questions.
As a follow up. In the northwind the employee table uses Image Control which is not bound to a table. I want to use a Bound Object Frame and embed the image on the database. I know it would increase the size of the database but I made a sample of 500 employees with ID picture and its only 25 mb (still manageable). I just did a manual selecting (using Insert picture - right click on the bound object frame).How can I create a VBA procedure to select a picture (using OpenDialog box) and paste that image of the employee on the form?
May 20 '07 #5
I revised the code in northwind.

I used these codes. What's wrong with this?

Sub getFileName()
' Displays the Office File Open dialog to choose a file name
' for the current employee record. If the user selects a file
' display it in the image control.
Dim Filename As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Employee Picture"
.Filters.Add "Bitmaps", "*.bmp"
.FilterIndex = 3
.AllowMultiSelect = False
.InitialFileName = CurrentProject.path
result = .Show

If (result <> 0) Then
Filename = Trim(.SelectedItems.Item(1))
Me.IDPicture.ControlSource = Filename
End If
End With
End Sub
May 20 '07 #6
Denburt
1,356 Expert 1GB
I revised the code in northwind.

I used these codes. What's wrong with this?
Expand|Select|Wrap|Line Numbers
  1. Sub getFileName()
  2. Me!IDPicture.Action = acOLEInsertObjDlg
  3. End Sub
I worked with this in the past and for the life of my I had to google for the method. I guess I am getting old. Good luck let us know how it goes.

Microsoft Link
May 21 '07 #7
I worked with this in the past and for the life of my I had to google for the method. I guess I am getting old. Good luck let us know how it goes.

Microsoft Link
Thanks again but I want to use the

Application.FileDialog(msoFileDialogFilePicker)

to pick the file that I want to insert.

Your method opens up an Insert Object dialog then the user selects any other file. If the user selects the wrong type of file the image will not be shown on the OLE Bound frame box.

If I can't find any other method in the internet I'll use your method.

Thanks
May 22 '07 #8
Denburt
1,356 Expert 1GB
Like I said I must be getting old, i can remember writing a routine that imported multiple pics for this purpose I will try and look around to see if I can recolecte the procedure just be carefull for the 2 gig limit, it can come so awefully fast.
May 22 '07 #9
My only problem is if this database is used in a computer where there are so many graphics program or even a Nero 7 DVD writing software installed, it doesn't show up the pictures coz Nero 7 grabs all bitmap files as its default so Access doesn't recognize Nero 7 bmp files. I had to re-install Nero 7 and unselect the BMP in the file associations screen.
May 23 '07 #10
Denburt
1,356 Expert 1GB
That could be a problem, it sounds like you should check to see what program opens a bitmap first then change it as needed through code... It may take some effort but could pay off in the long run.
May 23 '07 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: matt | last post by:
I have this code, works perfectly on Windows server, but now i'm trying to run it on a Linux server, the form submits, i get no errors, but the photo doesnt upload, and the caption file doesnt...
3
by: Ken | last post by:
I have a database called autographs.mdb that is in the "XYZ" folder in the "database" folder. I have a form in the database that I want to display a photo of the celeb on. The photos are in a...
1
by: Bill Strass | last post by:
I have a form showing the records of different people. I would like a photo to be displayed in the form, with each person's record. My digital photo > *.jpg type file and I change each photo...
0
by: dvorett | last post by:
I know this topic has been discussed a lot but after going through the old posts, I'm still having trouble with the code. I have a photo name field which refers to the location of the photo on the...
5
by: bob garbados | last post by:
I am trying to create a database-driven photo gallery for a friend with an admin form to upload images... I can upload a file to the web server, but I want to store the image in a database and I...
4
by: TomA | last post by:
Hi All, I have a picturebox on a form containing the photo of a person. As you advance through the records, the photo updates. Rather than storing the images in an inefficient blob field in a...
18
by: Sarati | last post by:
I'm using the data base that came with Access 2003 - I can greate a new form and add a photo per record, but for the life of me I can't make it work with the porducts form. The form is based on the...
7
by: NewDirections | last post by:
I have developed a Access 2000 database to run my business. I use it to track products, Sales, Customers, format Newsletters (select products) for mailing, and etc. What I need to do is add photos...
1
by: cumupkid | last post by:
II am trying to create a form that will allow me to upload photos to a folder in the site root directory and add the information to the mysql db at the same time. I have created two forms, one...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.