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
SharePoint List: How to add google maps location
New Windows 2008 Server - 8 GB of memory, 3gb free nothing on it?
Enter data in a MSFlexgrid control
Windows 7 Printer Driver Issues With HP LJ 1320 Series
Email Observation
Using A Variable In VBA SELECT Statement
Batch File to dump list of Hostnames to IP Addresses
Converting form MSSQL 2000 to MSSQL 2005
Adding a keyboard shortcut to a WPF MenuItem
Decommission temp DC in 2008, giong to 2008 R2 domain