Split db code error
Posted on 2007-10-18
I have the following code in an A2K db that deletes import error tables:
Public Function DeleteImportErrors()
'Deletes import error tables created by import, leaves 1 table only.
Dim db As Database
Dim intCount As Integer, intPos As Integer
Set db = CurrentDb
intCount = db.TableDefs.Count - 1
For intPos = intCount To 1 Step -1
If InStr(db.TableDefs(intPos).Name, "_ImportErrors") > 0 Then
DoCmd.DeleteObject acTable, db.TableDefs(intPos).Name
Set db = Nothing
This worked fine until I split the database. I'm assuming the problem lies with the "Set db = CurrentDb" line, but I don't know the syntax to point the code to the backend db on the server.
Any ideas would be appreciated!