I opened an old project of Access. I have some problems with these objects that are no longer used.
I'm following this guide: http://support.microsoft.com/kb/129883/en
The part of the code in question is this:
Private Sub AGG_Dati()
Dim Dyna As Dynaset
Dim DB As Database
Set DB = CurrentDb()
Set Dyna = DB.CreateDynaset("SELECT DISTINCTROW TOrdiniCartone.* FROM TOrdiniCartone WHERE ((TOrdiniCartone.[Tipo Ordine] = ""S""));")
If Dyna.RecordCount > 0 Then Dyna.MoveLast
n = Dyna.RecordCount
If n > 0 Then
Dyna.MoveFirst
If " " & Forms![SOrdiniArticoli].[_CArt] <> " " & Dyna.[Codice Articolo] Then
Forms![SOrdiniArticoli].[_CArt] = Dyna.[Codice Articolo]
Forms![SOrdiniArticoli].[_CForn] = ""
MsgBox "Selezionare un Fornitore!"
Stato = 1
Else....
Following the guide, I changed to:
Private Sub AGG_Dati()
Dim Dyna As Recordset
Dim DB As Database
Set DB = CurrentDb()
Set Dyna = DB.OpenRecordset("SELECT DISTINCTROW TOrdiniCartone.* FROM TOrdiniCartone WHERE ((TOrdiniCartone.[Tipo Ordine] = ""S""));", dbOpenDynaset)
It gives me error here: Dyna.[Codice Articolo]
[Codice Articolo] is a field in the table TOrdiniCartone
Does anyone know these things?