LOUISBUHAGIAR54
Registered User.
- Local time
- Today, 15:40
- Joined
- Mar 14, 2010
- Messages
- 157
My database contains a list of residents in a retirement home. One of my forms contains all their particulars. My goal is to get each one's picture on the form.
I know I could include the filepath of each picture as field in the table containing their particulars and include this as a field in the form and then put this field as the control souce of the image. I tried this method and it works fine. However I do not want to burden my table with unnecessary data.
Another method is to use code on the On current event of the form. This is the code which i have used;
Private Sub Form_Current()
Me!Image91.Picture = "C:\Users\Louis\Pictures\Residents Pictures\" & Me.idcard_no & ".jpg"
End Sub
"C:\Users\Louis\Pictures\Residents Pictures\" being a constant part of the file path of the pictures.
All individual pictures are named according to an id number which is the same one as the idcard_no on the form.
However when I try to run this form I can an error message so:
Runtime error 2220
can't open the file;
"C:\Users\Louis\Pictures\Residents Pictures\0003801A"
the last part of the file path not being the id number of the individual requested, and this message and file path is always the same regardless of which resident is requested.
I find this confusing and cannot make heads or tails.
Can someone please help ?
Louis
I know I could include the filepath of each picture as field in the table containing their particulars and include this as a field in the form and then put this field as the control souce of the image. I tried this method and it works fine. However I do not want to burden my table with unnecessary data.
Another method is to use code on the On current event of the form. This is the code which i have used;
Private Sub Form_Current()
Me!Image91.Picture = "C:\Users\Louis\Pictures\Residents Pictures\" & Me.idcard_no & ".jpg"
End Sub
"C:\Users\Louis\Pictures\Residents Pictures\" being a constant part of the file path of the pictures.
All individual pictures are named according to an id number which is the same one as the idcard_no on the form.
However when I try to run this form I can an error message so:
Runtime error 2220
can't open the file;
"C:\Users\Louis\Pictures\Residents Pictures\0003801A"
the last part of the file path not being the id number of the individual requested, and this message and file path is always the same regardless of which resident is requested.
I find this confusing and cannot make heads or tails.
Can someone please help ?
Louis