P
Primoz Bradac
Using Access 2003 I found the following to be a greater problem than
expected.
I have a simple Employees table. One of the fields (a text field!)
contains the employee's picture filename which is a .BMP file residing
in the same directory as the .MDB file.
I want to put the employee's picture on the form (which shows also other
employee's data).
For the life of me I can't figure out :
- what control to put on the form for the picture
- what is the VBA statement to be put into the Form_Current procedure
to display the picture of the current employee.
I've tried several options but none seems to work. The latest I'm stuck
with is:
Private Sub Form_Current()
Me![Pic41].Picture = Application.CurrentProject.Path & "\" & Me![Pic]
End Sub
Pic41 is an image control and Pic is the name of text field on the form
which is bound to the correspondig field in the record
..
What I get is:
Runtime Error 2220
MS Access can't open the file ...
(the path and the file name are correct!)
I've tried With Oleobject field type in the record and Oleobject control
on the form. It worked, but I don't want to have the pictures embedded.
TIA,
Primoz
expected.
I have a simple Employees table. One of the fields (a text field!)
contains the employee's picture filename which is a .BMP file residing
in the same directory as the .MDB file.
I want to put the employee's picture on the form (which shows also other
employee's data).
For the life of me I can't figure out :
- what control to put on the form for the picture
- what is the VBA statement to be put into the Form_Current procedure
to display the picture of the current employee.
I've tried several options but none seems to work. The latest I'm stuck
with is:
Private Sub Form_Current()
Me![Pic41].Picture = Application.CurrentProject.Path & "\" & Me![Pic]
End Sub
Pic41 is an image control and Pic is the name of text field on the form
which is bound to the correspondig field in the record
..
What I get is:
Runtime Error 2220
MS Access can't open the file ...
(the path and the file name are correct!)
I've tried With Oleobject field type in the record and Oleobject control
on the form. It worked, but I don't want to have the pictures embedded.
TIA,
Primoz