olá gostaria de saber o que pode estar errado neste cod. para esta mensagem!! Grato
Private Sub Text1_LostFocus()
Dim AreaTrabalho As Workspace
Dim query As String
Dim xxbco As Database
Set AreaTrabalho = DBEngine.Workspaces(0)
Set XBCO = AreaTrabalho.OpenDatabase(App.Path & "Temp.Mdb", False, False)
query = "Select * From Temp order by D1"
Set DYN1 = XBCO.OpenRecordset(query)
While Not DYN1.EOF
DYN1.Delete
DYN1.MoveNext
Wend
Set AreaTrabalho = DBEngine.Workspaces(0)
Set xxbco = AreaTrabalho.OpenDatabase(App.Path & "Estoque.Mdb", False, False)
query = "SELECT* FROM Cadastro order by E12"
Set dyn = xxbco.OpenRecordset(query)
While Not dyn.EOF
If CStr(dyn("E12")) <= CStr(Text1) Then
DYN1.AddNew
DYN1("d1") = dyn("E12")
DYN1("d2") = dyn("E4")
DYN1("d3") = dyn("E5")
DYN1("d4") = dyn("E7")
DYN1("d5") = dyn("E8")
DYN1("d6") = dyn("E1")
DYN1.Update
End If
dyn.MoveNext
Wend
XBCO.Close
xxbco.Close
Data1.Refresh
End Sub