Ex.
TabSabor
mussarela pizza
calabreza pizza
cola refrigerante
preciso que a rotina pesquise a tabela e so filtre (mussarela e calabreza)
e preencha campo1 e campo2 no formulario ..
estes campos sao nao vinculados.
Desde ja agradeço a todos
Private Sub Form_Load()
'By JPaulo © MaximoAccess
Dim emptyImg As String
Dim i As Integer
Dim rst As Recordset
' emptyImg = "C:\PDD_Alterado\imagens\pizza\" & "SemFoto.gif"
emptyImg = Application.CurrentProject.Path & "\imagens\pizza\" & "SemFoto.gif"
On Error Resume Next
Set rst = CurrentDb.OpenRecordset("select * from TabSabor WHERE Categoria = 6")
rst.MoveLast
rst.MoveFirst
For i = 1 To 10
If IsNull(rst!LocalFoto) Then
Me.Controls("txt" & i).Value = rst!sabor
Me.Controls("foto" & i).Picture = emptyImg
Else
Me.Controls("txt" & i).Value = rst!sabor
Me.Controls("foto" & i).Picture = Application.CurrentProject.Path & "\imagens\pizza\" & rst!LocalFoto
End If
rst.MoveNext
Next
rst.Close: Set rst = Nothing
End Sub