eu to com esse codigo no active report pra imperssao de foto buscandoi ela numa pasta e guardando o caminho dela no banco esta dano ero de " Item cannot be found in the collection corresponding to the request name or ordinal"
"If Len(rst!Figura) <> 0 Then" nesse item alguem pode me ajudar
Me.MousePointer = 11
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sPath As String
sPath = App.Path & "Bdimobiliaria.MDB"
FecharRst
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sPath
cn.Open
Set rst.ActiveConnection = cn
rst.CursorLocation = adUseClient
'Altere, no bd a propriedade do CodigoImo para duplicação não autorizada e tipo numérico
sSql = "Select * from Tbl_imagensApart where PROD_COD = " & txtCodigo.Text 'Aqui estava o erro (Where CodigoImo e não Figura..)
Set rst.ActiveConnection = cnBd
rst.CursorLocation = adUseClient
rst.Open sSql, , adOpenStatic, adLockBatchOptimistic
If rst.BOF And rst.EOF Then
MsgBox "Não há registros!!"
Exit Sub
End If
'MsgBox rst!Figura, vbInformation, "Nome da figura gravada no bd:"
If Len(rst!Figura) <> 0 Then
sPathFigura = App.Path & "fotos" & rst!Figura
Else
MsgBox "O nome da figura não está cadastrado no banco de dados!!", vbInformation, "Apartamento sem foto!!!"
End If
rst.ActiveConnection = Nothing
Dim rpt As New rptRelApart
Set rpt = New rptRelApart
rpt.DataControl1.Recordset = rst
rpt.Show 1