G
Guest
I would prefer to use the execute statement, but for some reason I get an
error message. Can someone PLEASE explain why.
'Code in either case
Dim strSQL As String, myTable As String, qdf As DAO.QueryDef
myTable = "tblM_" & "_" & Me.cboIUFList ' returns something like "tblM_1"
CurrentDb.TableDefs.Refresh
'I check to see if the table exists, if so I want to delete the contents
strSQL = "DELETE " & myTable & ".* FROM " & myTable & ";"
'this works
DoCmd.RunSQL strSQL
'this doesn't work - returns error "Item not found in this collection -
error 3265"
Set qdf = CurrentDb.QueryDefs(strSQL)
qdf.Execute dbSeeChanges
error message. Can someone PLEASE explain why.
'Code in either case
Dim strSQL As String, myTable As String, qdf As DAO.QueryDef
myTable = "tblM_" & "_" & Me.cboIUFList ' returns something like "tblM_1"
CurrentDb.TableDefs.Refresh
'I check to see if the table exists, if so I want to delete the contents
strSQL = "DELETE " & myTable & ".* FROM " & myTable & ";"
'this works
DoCmd.RunSQL strSQL
'this doesn't work - returns error "Item not found in this collection -
error 3265"
Set qdf = CurrentDb.QueryDefs(strSQL)
qdf.Execute dbSeeChanges