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
Keyboard shortcut to close database window
Layout Suggestions
SBS 2008 Console Querying Security Status
How do I retrieve text from a website
SBS 2008 Updates in progess never complete
XP SP3 - Unmitigated Disaster
Pass the current form name to a function within a module
Rolling back transactions in Access (using ADO, DAO, Access code, whatever)
Need to pull Certain Info from a Website and import it to Excel
How to stop duplicate alerts from being sent to the same individual who belongs to multiple groups