Tupacmoche
Registered User.
- Local time
- Today, 02:16
- Joined
- Apr 28, 2008
- Messages
- 291
Hi VBA/SQL Masters,
I have the following vba script to truncate an SQL table. I keep getting a run-time error 3265 - Item not found in collection. But, I can't figure out what is wrong. Does anyone know how to fix it?
Private Sub btnBM_Click()
Dim qdef As DAO.QueryDef
Set qdef = CurrentDb.CreateQueryDef("")
qdef.Connect = CurrentDb.TableDefs("dbo.FinderFile").Connect
qdef.SQL = "Truncate table med.dbo.FinderFile"
qdef.ReturnsRecords = False
qdef.Execute
MsgBox ("Your file is now processing...")
End Sub
I have the following vba script to truncate an SQL table. I keep getting a run-time error 3265 - Item not found in collection. But, I can't figure out what is wrong. Does anyone know how to fix it?

Private Sub btnBM_Click()
Dim qdef As DAO.QueryDef
Set qdef = CurrentDb.CreateQueryDef("")
qdef.Connect = CurrentDb.TableDefs("dbo.FinderFile").Connect
qdef.SQL = "Truncate table med.dbo.FinderFile"
qdef.ReturnsRecords = False
qdef.Execute
MsgBox ("Your file is now processing...")
End Sub