Hi all,
I have a database splitted in Front End / Back End.
I am trying to delete some specific records ("activityID") using VBA code in every table that starts with "tblActivity". The code I am using is:
Although in the tdf.name the tblActivity appears when comes to run the Delete I have an error message:
Error 3078 - The Microsoft Jet database engine cannot find the input table or query "tblActivity"...
What am I doing wrong?
Probably good to mention that I don't have linked tables!!
Thanks
I have a database splitted in Front End / Back End.
I am trying to delete some specific records ("activityID") using VBA code in every table that starts with "tblActivity". The code I am using is:
Code:
For Each tdf In db.TableDefs
If Left$(tdf.name, 11) = "tblActivity" Then
strDelete = "DELETE [" & tdf.name & "].* " & _
"FROM [" & tdf.name & "] " & _
"WHERE [" & tdf.name & "]" & ".[activityID] = " & intActivityID
DoCmd.SetWarnings False
DoCmd.RunSQL strDelete
DoCmd.SetWarnings True
End If
Next tdf
Although in the tdf.name the tblActivity appears when comes to run the Delete I have an error message:
Error 3078 - The Microsoft Jet database engine cannot find the input table or query "tblActivity"...
What am I doing wrong?
Probably good to mention that I don't have linked tables!!
Thanks