By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,982 Members | 1,738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,982 IT Pros & Developers. It's quick & easy.

Attaching ID Photo to a form

P: 52
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
Share this Question
Share on Google+
10 Replies


Denburt
Expert 100+
P: 1,356
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

P: 52
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
Expert 100+
P: 1,356
Great feel free to ask any questions.
May 17 '07 #4

P: 52
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

P: 52
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
Expert 100+
P: 1,356
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

P: 52
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
Expert 100+
P: 1,356
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

P: 52
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
Expert 100+
P: 1,356
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

Post your reply

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