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
New RAM Causing laptop to shut down
How to Send Alert Info from Dell Open Manager Via Email
Error While Importing Microsoft CRM 4.0 Database
need install windows from lan
determine if an Access DB (.mdb) is being opened for the first time on any given day
Drawing and Scolling in Windows C# - ClientRectangle? Paint?
Access 2007 Union Query With Linked Tables
Server 2008R2 and XP Roaming Profiles
SQL Server 2005 Linked Server Oracle 9i Error message ORA-12154
Can't log into domain