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
Why is this so hard? Form2.show() Form1.hide() Does .Net not support this?
Sum data in multiple fields and store number in another field
How can I transfer Adobe CS2 license to another system?
Insert formula to range
Need a simple script
Not sure of what the numeric value would be for align left.
Why does Format([Del Date],"ww") give 53 weeks?
c# installer for webservice
Virtual Server 2005 R2 'fatal error' when attempting to resume from saved state
Position cursor to specified line in multiline textbox