Foros del Web » Soporte técnico » Ofimática »

Se repiten las fotos en Informe de Access

Estas en el tema de Se repiten las fotos en Informe de Access en el foro de Ofimática en Foros del Web. Hola, tengo una base de datos con fotos que van corriendo en el formulario a medida que las voy pasando. Hasta ahí todo bien. El ...
  #1 (permalink)  
Antiguo 10/06/2009, 14:43
 
Fecha de Ingreso: julio-2008
Mensajes: 26
Antigüedad: 15 años, 9 meses
Puntos: 0
Se repiten las fotos en Informe de Access

Hola, tengo una base de datos con fotos que van corriendo en el formulario a medida que las voy pasando. Hasta ahí todo bien.
El problema es que al querer imprimir un informe la misma foto se repite en todos los registros.
Que puede ser?
Copio el módulo general, el de el formulario y el de el informe, a ver que estoy haciendo mal.
Muchas gracias.

Option Compare Database
Option Explicit
Public Function DisplayImage(ctlImageControl As Control, strImagePath As Variant) As String
On Error GoTo Err_DisplayImage
Dim strResult As String
Dim strDatabasePath As String
Dim intSlashLocation As Integer
With ctlImageControl
If IsNull(strImagePath) Then
.Visible = False
strResult = "No image name specified."
Else
If InStr(1, strImagePath, "\") = 0 Then
' Path is relative
strDatabasePath = CurrentProject.FullName
intSlashLocation = InStrRev(strDatabasePath, "\", Len(strDatabasePath))
strDatabasePath = Left(strDatabasePath, intSlashLocation)
strImagePath = strDatabasePath & strImagePath
End If
.Visible = True
.Picture = strImagePath
strResult = "Image found and displayed."
End If
End With

Exit_DisplayImage:
DisplayImage = strResult
Exit Function
Err_DisplayImage:
Select Case Err.Number
Case 2220 ' Can't find the picture.
ctlImageControl.Visible = False
strResult = "Can't find image in the specified name."
Resume Exit_DisplayImage:
Case Else ' Some other error.
MsgBox Err.Number & " " & Err.Description
strResult = "An error occurred displaying image."
Resume Exit_DisplayImage:
End Select
End Function

Ahora va el de el formulario (que también funciona bien)

Option Compare Database
Option Explicit
Private Sub Form_AfterUpdate()
CallDisplayImage
End Sub
Private Sub Form_Current()
CallDisplayImage
End Sub
Private Sub Foto_AfterUpdate()
CallDisplayImage
End Sub
Private Sub CallDisplayImage()
Me!txtImageNote = DisplayImage(Me!ImageFrame, Me!Foto)
End Sub

Y ahora el de el informe que repite las fotos

Option Compare Database
Option Explicit
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Me!txtImageNote = DisplayImage(Me!ImageFrame, Me!txtImageFoto)
End Sub
  #2 (permalink)  
Antiguo 12/06/2009, 01:04
Avatar de Taribo007  
Fecha de Ingreso: agosto-2007
Mensajes: 1.338
Antigüedad: 16 años, 8 meses
Puntos: 18
Respuesta: Se repiten las fotos en Informe de Access

Prueba esto (algo mas sencillo) para cargar una imagen:

if len(dir(me.foto))>0 then
me.imagefarme.picture=me.foto
end if

A ver si con esto funciona. Por loq ue veo en tu codigo, entiendo que en el campo Foto esta la ruta de la iamgen

un saludo
  #3 (permalink)  
Antiguo 16/06/2009, 13:36
 
Fecha de Ingreso: julio-2008
Mensajes: 26
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Se repiten las fotos en Informe de Access

Cita:
Iniciado por Taribo007 Ver Mensaje
Prueba esto (algo mas sencillo) para cargar una imagen:

if len(dir(me.foto))>0 then
me.imagefarme.picture=me.foto
end if

A ver si con esto funciona. Por loq ue veo en tu codigo, entiendo que en el campo Foto esta la ruta de la iamgen

un saludo
Muchísimas gracias. Todo perfecto.
Gracias de verdad por vuestro tiempo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:53.