Basic splitting and VBA code that no longer works
beodeo
Posted messages
8
Status
Member
-
beodeo Posted messages 8 Status Member -
beodeo Posted messages 8 Status Member -
Hello,
I have just split my Access database.
My code was working perfectly before, but now, when I close my "contacts" form, the execution of code modifying the "contacts" table (the source table of the form) results in an execution error 3048 ("Cannot open more databases").
Excerpt from the code:
My code stops at:
Thank you
Configuration: Windows 7 / Internet Explorer 9.0
I have just split my Access database.
My code was working perfectly before, but now, when I close my "contacts" form, the execution of code modifying the "contacts" table (the source table of the form) results in an execution error 3048 ("Cannot open more databases").
Excerpt from the code:
Dim DistantDB As DAO.Database Dim SQLcode2 as String SQLcode2 = "DELETE [RETOUR FORMULAIRE PRECEDENT].* FROM [RETOUR FORMULAIRE PRECEDENT];" DistantDB.Execute SQLcode2 DistantDB.Close Set DistantDB = Nothing
My code stops at:
DistantDB.Execute SQLcode2
Thank you
Configuration: Windows 7 / Internet Explorer 9.0
3 answers
-
Hi,
What does DistantDB contain?
Because I don't see it taking any value in your code...
--
See you, blux"You can't trust idiots. That's how you recognize them."
-
Good evening,
oops I forgot a line
Dim DistantDB As DAO.Database Dim SQLcode2 as String SQLcode2 = "DELETE [RETOUR FORMULAIRE PRECEDENT].* FROM [RETOUR FORMULAIRE PRECEDENT];" Set DistantDB = CurrentDb DistantDB.Execute SQLcode2 DistantDB.Close Set DistantDB = Nothing
-
small clarifications:
1/: I brought my table local and now there are no more issues...
but with the connection, I still get the same error message.
2/: in my form, I have sub-forms that use this famous table as a source via queries.
if this helps clarify things further...