TotalRapture
New Member
- Joined
- Jun 30, 2017
- Messages
- 15
Good Afternoon!
I have a series of updates to run on a table and I was hoping to automate them with one click. I tried using the execute method as described here:
https://www.fmsinc.com/MicrosoftAccess/query/action-queries/SuppressWarningMessages.htm
The problem is, when I put my query name into the execute line and try to run I receive the error:
Run-time Error '3078':
The Microsoft Access database engine cannot find the input table or query ". Make sure that it exists and that its name is spelled correctly.
It reads to me as if it can't find the update query, but I've triple checked that everything is spelled right. Could anyone help me with some troubleshooting? Thank you all for your time! Here is the VBA:
Private Sub Command0_Click()
Dim dbs As DAO.Database
Dim lngRowsAffected As Long
'Dim lngRowsDeleted As Long
Set dbs = CurrentDb
' Execute runs both saved queries and SQL strings
dbs.Execute cstrUpdate_1, dbFailOnError
' Get the number of rows affected by the Action query.
' You can display this to the user, store it in a table, or trigger an action
' if an unexpected number (e.g. 0 rows when you expect > 0).
lngRowsAffected = dbs.RecordsAffected
End Sub
I have a series of updates to run on a table and I was hoping to automate them with one click. I tried using the execute method as described here:
https://www.fmsinc.com/MicrosoftAccess/query/action-queries/SuppressWarningMessages.htm
The problem is, when I put my query name into the execute line and try to run I receive the error:
Run-time Error '3078':
The Microsoft Access database engine cannot find the input table or query ". Make sure that it exists and that its name is spelled correctly.
It reads to me as if it can't find the update query, but I've triple checked that everything is spelled right. Could anyone help me with some troubleshooting? Thank you all for your time! Here is the VBA:
Private Sub Command0_Click()
Dim dbs As DAO.Database
Dim lngRowsAffected As Long
'Dim lngRowsDeleted As Long
Set dbs = CurrentDb
' Execute runs both saved queries and SQL strings
dbs.Execute cstrUpdate_1, dbFailOnError
' Get the number of rows affected by the Action query.
' You can display this to the user, store it in a table, or trigger an action
' if an unexpected number (e.g. 0 rows when you expect > 0).
lngRowsAffected = dbs.RecordsAffected
End Sub