Salve a tutti...
Ho un problemino con una function che non ne vuol sapere di funzionare....Vi
spiego un attimo.....ho due mdb, uno è il gestionale e l'altro è l'archivio.
Il problema è che quando vado a scrivere nell'archivio il pc non mi si
collega dandomi un errore di runtime dicendomi che l'utente ADMIN ha messo il database in uno stato in cui è impossibile aprirlo o modificarlo....(non ho fatto nulla di tutto ciò). Non solo se lancio il solo codice non mi apre il db archivio nel recordset che vorrei io dicendo che è necessario 1...poi questo 1 che cavolo sarà.....?
Vi incollo il codice:

Option Compare Database
Option Explicit

Public Function SalvataggioOfferteSuArchivio2()
Dim dbs As Database
Dim db As Database
Dim rst As Recordset, rst2 As Recordset, rsta1 As Recordset, rsta As
Recordset, rsControlloOf As Recordset, rsControlloDf As Recordset
Dim strSQL As String
Dim strSql2 As String
Dim strSQL3 As String
Dim strSQL4 As String
Set db = CurrentDb
strSql2 = "SELECT * FROM Offerta WHERE IDOfferte = " &
Forms!Offerte01!IDOfferte & ""
strSQL = "SELECT * FROM DettaglioOfferta WHERE IDOfferte = " &
Forms!Offerte01!IDOfferte & " ORDER BY Riga"
strSQL3 = "SELECT * FROM Offerta WHERE IDOfferte = " &
Forms!Offerte01!IDOfferte & ""
strSQL4 = "SELECT * FROM DettaglioOfferta WHERE IDOfferte = " &
Forms!Offerte01!IDOfferte & " ORDER BY Riga"
Set dbs = OpenDatabase("C:\Documenti\ArchivioEstero.mdb")
Set rst = dbs.OpenRecordset(strSQL4, dbOpenDynaset)
Set rst2 = dbs.OpenRecordset(strSQL3, dbOpenDynaset)
Set rsta = db.OpenRecordset(strSQL, dbOpenDynaset)
Set rsta1 = db.OpenRecordset(strSql2, dbOpenDynaset)

mi continua a dare errore sul rst dicendomi che è necessario 1.......chi sà
dirmi se il codice è sbagliato e come risolvere sta cosa???

Io dovrei aprire il recordset del db archivio che corrisponde a: Forms!Offerte01!IDOfferte (campo numerico).

Grazie a chiunque possa aiutarmi )))



Grazie ancora a tutti!!


Ultra