Hi, everybody!
I have an ADO Control which has nothing set for its recordsource in the window property.
I'm trying to set this property using code:
Private Sub Form_Load()
Set MyDb = OpenDatabase("MyDatabaseName")
Set Pesq = MyDb.OpenRecordset("SELECT Equipamentos.TAG, Aferições.Data, Aferições.Status FROM Equipamentos INNER JOIN Aferições ON Equipamentos.CÓD = Aferições.EquipId Where (Equipamentos.Tag) = '" & DtCmbTAG & "'", dbOpenForwardOnly)
========
MyAdoData.Recordsource = Pesq
This line causes an error: run-time error '13'type mismatch
========
Set Pesq = Nothing
MyDb.Close
End Sub
How can I get it to work?
I've tried to add the SQL into the property window, but I couldn't get it to work there, maybe cause it's too complex. so I've decided to use code.
Any ideas?
Thanks in advance,
Roselene
