Microsoft
Software
Hardware
Network
Question : MS Access VBA - test if docmd.openquery successful
If I run the following code....
docmd.setwarnings false
docmd.openquery "qryUpdate"
docmd.setwarnings true
how can I test if it has been successful or not. For example, because I have warnings switched off, if I do an update query that puts text into a number field it fails but doesn't tell me. How can I get around this (without switching warnings back on which isn't an option)
Many thanks
Answer : MS Access VBA - test if docmd.openquery successful
You can switch to a different method, which will error out if trouble arises:
Sub SomeButton_Click()
On Error Goto ProcErr
Currentdb.Execute "The SQL FROM qryUpdate"
Exit Sub
ProcErr:
Msgbox Err.Number & ": " & Err.Desciption
End Sub
Random Solutions
Outlook 2007 Add-in menu button click event... Strange behavior.
Query showing Last Results only
Debugging buttons disabled in visual studio 2008
Printer sharing between Microsoft Windows 7 and MAC Snow Leopard
Unique index dependent on a column
How do I add a ComboBox to a C# Datagridview only in a particular cell? Not the whole column.
[http error 400 - request is badly formed] appears randomly in .net application
Microsoft Outlook Delayed delivery option- Would like time stamp to show in sent items when email is actually sent and not when its activated
Update Temp Recordset using VBA
loop through all the DataRows in an array of data rows to update rows in a table