Stando a MS dovrebbe funzionare:
http://msdn.microsoft.com/en-us/library ... e.12).aspxprova a dirci:
- versione di access
- come apri il db (codice vba)
- dove sta scritto il codice (module1.vb)
- come è fatto il codice (sorgente della sub/funcion)
la query sembra giusta, deve essere uno degli altri fattori a causare il problema
vedi l'esempio:
This example changes values in the ReportsTo field to 5 for all employee records that currently have ReportsTo values of 2.
- Codice: Seleziona tutto
Sub UpdateX()
Dim dbs As Database
Dim qdf As QueryDef
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("Northwind.mdb")
' Change values in the ReportsTo field to 5 for all
' employee records that currently have ReportsTo
' values of 2.
dbs.Execute "UPDATE Employees " _
& "SET ReportsTo = 5 " _
& "WHERE ReportsTo = 2;"
dbs.Close
End Sub