Hi to all,
I have a form that has pictures of each person on it. The pictures are stored in a file which the filename refers to the field on the db. I refer to those file names using this code, and I get right fotos for every single person.
Here is the code I use:
Private Sub Form_Current()
If Me![ID] <> 0 Then
Me!Image4.Picture = "F:\Fotos\" & Me![ID] & ".jpg"
End If
End Sub
How do I DO THE same thing on a REPORT?
I keep getting the same foto for every record which refers to the last row in the database field.
Here is the code I use:
Private Sub Report_Activate()
Dim db As Database
Dim rs As dao.Recordset
Dim sRec As String
Dim strID As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("select ID from Employees"
Do Until rs.EOF
If rs.Fields("ID" <> 0 Then
strID = rs.Fields("ID"
Me!Image29.Picture = "F:\Fotos\" & strID & ".jpg"
rs.MoveNext
Else
Print "something"
End If
Loop
rs.Close
Set rs = Nothing
CAN ANYBODY JUST LETS ME NOW IF THIS EVEN POSSIBLE.
I HAVE A DEADLINE SOON, SO AT LEAST I COULD THINK SOMETHING ELSE.
Thanks in advance.
Afrim
afrim.shala@omik.org
I have a form that has pictures of each person on it. The pictures are stored in a file which the filename refers to the field on the db. I refer to those file names using this code, and I get right fotos for every single person.
Here is the code I use:
Private Sub Form_Current()
If Me![ID] <> 0 Then
Me!Image4.Picture = "F:\Fotos\" & Me![ID] & ".jpg"
End If
End Sub
How do I DO THE same thing on a REPORT?
I keep getting the same foto for every record which refers to the last row in the database field.
Here is the code I use:
Private Sub Report_Activate()
Dim db As Database
Dim rs As dao.Recordset
Dim sRec As String
Dim strID As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("select ID from Employees"
Do Until rs.EOF
If rs.Fields("ID" <> 0 Then
strID = rs.Fields("ID"
Me!Image29.Picture = "F:\Fotos\" & strID & ".jpg"
rs.MoveNext
Else
Print "something"
End If
Loop
rs.Close
Set rs = Nothing
CAN ANYBODY JUST LETS ME NOW IF THIS EVEN POSSIBLE.
I HAVE A DEADLINE SOON, SO AT LEAST I COULD THINK SOMETHING ELSE.
Thanks in advance.
Afrim
afrim.shala@omik.org