Access Vba Run Query Return Value

Where / how do you use them? By opening the select query all you have done is got the values sitting there occupying memory in Access until either the query or Access is closed. Then if it has 0 rows you can show a label or whatever (some controls even have a property to tell what message should be shown if you bind them to a source with no rows). What I want to do is add to the form open event a check if the employee position has changed and update a text box with a numeric value if it has. It is possible for the columns to be in different locations every time because the data comes from a query in Access. These act as constraints on the query, meaning they either add predicates to the underlying XPath query or filter the result, and there can be any number of predicates. In this article I want to explore the pros and cons of using rich SQL queries that may contain domain logic. [ISCent er_EventLo g] with the Event Following data see below - Sql will create a new record - it is that EvnetID I need to capture inorder to update the remaining. If you execute Visual Basic code containing the OpenQuery method in a library database, Microsoft Access looks for the query with this name first in the library database, and then in the current database. Several properties of the ADO command object can be assigned values to make the query more efficient. Dir List the files in a folder. Below I've done just that. Here is sample how to use plexian: Requirements. Access to Access Task Attributes After you retrieve an access task object, you access its attribute data through the methods in the base interface Task. The following example shows two columns of information per company, a count of the number of orders, and the order totals for each year: Company Name 1998 Orders 1998 Total 1999 Orders 1999 Total. Microsoft Access date functions are a powerful way to retrieve and analyze data in your Access databases, but very few users know about these functions or how to use them. The value returned is #VALUE!, but if I change the code to SQL = 1 + 2, then the value is 3. Queries which returns NO records like DELETE, INSERT, UPDATE, ROLLBACK, COMMIT… etc. How do I construct an SQL statement in VBA? Constructing an SQL statement in VBA can be tricky, because there are often several areas of Access needed to construct the string. Hello, I am new to VBA and have successfully got some VBA code in Excel to open and access a parameter query in Access 2003. 1 has been released! Codenamed "Business as Usual", 3. 0, you have to manually enter the Option Explicit statement into each module, form, and report. badgerDB is an embedded key-value store, and badgerhold serves a similar use case however with a higher level interface for common uses of Badger. preventDefault() on the event object or by returning false from our handler. This is part 3 of the article series - 8 ways to return multiple values from a VBA function. Why is it? You can import Access table data to Excel without even opening the Access DB. For example, you can use the Run method from an ActiveX component to carry out a Sub procedure that is defined within an Access database. Use your knowledge of loops to create your own VBA projects and see how it works. Where / how do you use them? By opening the select query all you have done is got the values sitting there occupying memory in Access until either the query or Access is closed. If you run into problems, check out your DNS service website for any setup guidance. mdb" the functions return "C:\mydb\". uk - database solutions and downloads for microsoft access. How to: Execute Queries that Return Scalar Values This topic provides examples of how to execute SQL queries and retrieve scalar values by using Telerik Data Access Commands or the Context API. i set up a data transfer from access gt excel using vba the access query i use the following instruction set pres. Microsoft Access Query Tips and Techniques (SQL and VBA) by Luke Chung, President of FMS, Inc. After being used, the InputBox() function returns a string. Learn More Using Knowledge Exchange™ , store valuable company content, including videos, articles, training materials, and more. Keeping a tab on the index is very important…. However, mocking this interface constitutes significantly. There is very little online about Access VBA and I have programmed a very comprehensive and complex database to run a landscaping company. If an item matches with all the criteria you enter, it appears in the query results. can be created faster than writing a VBA code. doc", vbNormal Result: Sets the file to Normal SetAttr. With greater technological advances, marketing professionals and organizations need to stay ahead of their competitors. What would be the sytax to do this via. static QueryExecution. You can execute Function procedures and call the function in Excel 2016. when run within Access. Elizabeth Gallagher, CRO of Lineate, hones in on the 2020 MarTech trends companies and marketers should act on now. The select query is perhaps the most commonly used query – this extracts information from the database and, in the case of VBScript, any results from the query are loaded into a recordset – in this example the contents of the id field from the name table are loaded into the recordset:. Click OK to get through both of the messages, and Access will run the query. we want to return the entire record. Apply a sort order to the query. ) TOP n records per group. If you execute Visual Basic code containing the OpenQuery method in a library database, Microsoft Access looks for the query with this name first in the library database, and then in the current database. If you want to work with the data in VBA then you would do a Select Query using a Recordset operation. As I said, I have plugged the SQL Statement into the Access SQL query pane and it returns one row, as expected. Also you might want to consider using SELECT COUNT(*) FROM Students and reading the value from the recordset instead of moving through the records to get the count. I loved the site. The key here is to have these functions all living in one place and reuse them all over the place. These are used to set the value of a noun and to compare the values of two nouns. Sometimes it needs to be run programmatically by access (programmatic query eg using loops). Returning the Number of Records or Rows Affected by an Action Query in Microsoft Access with VBA/VB6 Provided by: Molly Pell, Technical Project Manager Action queries in Microsoft Access are queries that add, modify, or delete records from tables using INSERT, UPDATE, and DELETE commands. If I get a match, I'd for TRUE to be returned, if not, return FALSE. Union Queries or Joining Queries Together. It will return one of two images from the two query strings. Code used in this article is based on a simple Access form as shown below. Amazon’s spokeswoman responded without a direct answer — saying only. Query To Return Record Set Where 1 Column Is Greater Than Another Jun 29, 2005. Update with Your Own VBA Function. article Everything I know about optimizing a WordPress install on Apache. Amazon’s spokeswoman responded without a direct answer — saying only. Alternative method to return Access Form input. Query: We use the query (Size >= 230 AND Sex. While partially evaluating policies, OPA doesn’t return a complete policy decision but instead it returns a set of conditions. “A customer may have a balance of $150. RE: Return a value from a RunSQL to vba RoyVidar (Instructor) 15 Sep 04 05:13 Nope - the runsql method of the docmd object is only good for action queries (delete, insert, upddate), not returning records. That is, it rounds to the nearest even number. To refer those values you can use the corresponding co-ordinates for respective cell value. How to return multiple values from a VBA function (Part 1) 16. You could also do half-and-half: loop through a recordset and grab the value of each row, then use that value to create a SQL insert statement. MVResultSet: executeQuery(java. OLEDB or JET. Mar 30, 2010 | Web Design & Development | By Shawn Parker. For example, you may add a button on an Access Form , where a user can simply click on that button to execute those commands automatically. Extracting a URL from a hyperlink on Excel is easy! Option 1: If you want to run this operation one time. Update with Your Own VBA Function. Train with Cloud Class ® to access on-demand courses on tech and business topics and work toward certifications. Java Project. getResultSet. The dynamic query runs fine but I am having trouble returning the value back to Access using VBA. We can search on a single form by using the VBA function to search for data on one field or more fields that we want to search for. Return field values from a query using a Recordset in VBA. SQL databases has mainly two type of authentication : 1. “A customer may have a balance of $150. Plexian - Autocomplete storage for Java applications. You could just create a query, or do CurrentDB. You can't write any VBA event procedures to run behind the Parameters dialog. It's a common and useful practice that we need to return more values from a function. Bug warning: If the function returns more than 255 characters, and you use it in a query as the source for another recordset, a bug in Access may return garbage for the remaining characters. Execute or docmd. Execute("select * from employees") Do Until. MS Access 2007: Query to retrieve max value but display all columns from original table This MSAccess tutorial explains how to create a query to retrieve the max value but also display all columns from the original table in Access 2007 (with screenshots and step-by-step instructions). If an item matches with all the criteria you enter, it appears in the query results. Convert the select query to an update query. Nz - Detect a NULL value or Zero Length string. Execute to run a query, you're using pure DAO, rather than Access, to do it, and DAO doesn't know about forms and controls on forms. General: DLookup Usage Samples. To open/run a query, use DoCmd. The VBA code I normally use to execute stored procedures as pass through queries does not seem to be working with. All replies. (start and end date), but you can ignore them. However, there are situations where you might want to access another database in order to run reports on the data. The sample uses a simple table which contains a name and a location field. Sometimes that means breaking up strings of data into smaller pieces so that you can run queries and reports based on the information they represent. How to return multiple values from a VBA function (Part 1) 16. While there are multiple methods to do this, one of the most versatile is leveraging SharePoint’s many web services directly via Visual Basic for Applications. Retrieving and Modifying Values from Result Sets. VBA Access SQL SELECT Query only returning one record. Double click the BANNER icon on your desktop to log into PROD – production, live database. OpenQuery "SampleQuery" In your situation, this is only useful if SampleQuery is an action query, i. can be created faster than writing a VBA code. A Long variable to which the provider returns the number of records that the operation affected. Easy ADODB Recordsets and Commands in Access When it comes to interacting with SQL Server procedures and data, I use ADODB exclusively in Access. 0 Example: Dim TheAngle. Return multiple values by using an array. OLEDB or JET. Common and Telerik. Use your knowledge of loops to create your own VBA projects and see how it works. 1 shifts focus back from widescale adoption to innovation. NET framework. The syntax for the Abs function is: Abs( number) The argument number can be any valid numeric expression. Last updated on 2018-08-14 by David Wallis. When you try to run a query, a form, or a report, the Enter Parameter Value dialog box may appear unexpectedly. For example, proper SQL syntax, proper VBA syntax, and proper referencing of controls are three common points. Note: To return the topmost or bottommost values without displaying duplicate values, set the UniqueValues property in the query's property sheet to Yes. Attempting to run a script in VBA that will pull data from an access database using SQL and put it into an excel spreadsheet. You can use an unbound form to do what you want. Select-Subquery - SubQuery Union - Combine the results of two SQL queries. All you need is a for/next loop based on the field count of your recordset that once the form is open sets each Form field equal to the recordset field value. Now when the form is submitted, the message is alerted. The sproc also works fine within query analyser of SQL Server 2000 (SP3). Last updated on 2018-08-14 by David Wallis. In this sql cheatsheet we will provide some common query questions asked and SQL solutions to these questions. Do an exploration with any computer programmer for ‘Stock Market Games’ or ‘Stock Market Simulations. 7), the data appears in order by first name and then within first name by last name (see Figure 3. You can't select the value from a combo box or use a format or input mask, which makes it likely that the user will enter invalid data or data not found in the database. The absolute value of a number is its unsigned magnitude. Maximize the use of TempVars in Access 2007 and 2010 The TempVars collection has the ability to save developers time, improve the reliability of your programming and provide you with new ways to share information across your application. Its formatted real well. A recordset can be described as a kind of table in the server's memory, containing rows of data (records), and each record is subdivided into individual fields (or columns). The VBA If. Fields(0)” in the result above, columns are returned based on “0” index. Click OK to get through both of the messages, and Access will run the query. First is the Collection in which we want to store our data and the second is the data itself. Connection Dim myRecordset As ADODB. VBAs to execute Insert, Update and Delete queries in MS Access You can use simple VBA commands to run the above queries. #3 – Use Tab Hound or Tab Control If all this code is making your head spin, the Tab Hound Add-in allows you to unhide multiple sheets with the click of a view buttons. This method can be used in any application that supports VBA. You could just create a query, or do CurrentDB. It is relatively easy to accomplish and the procedure below is one possible method. preventDefault() on the event object or by returning false from our handler. (IDbTypeParameter par) Adds the return parameter to the collection. Java Project. VBA functions (and other programming languages as well) can only return one value. Microsoft Access Outer Join Query: Finding All Records in One Table but Not Another and Creating "Not In" Queries by Molly Pell, Quality Assurance Specialist. Microsoft Access Query Tips and Techniques (SQL and VBA) by Luke Chung, President of FMS, Inc. Learn More Using Knowledge Exchange™ , store valuable company content, including videos, articles, training materials, and more. The SQL query returns a result in the form of a series of records. You don't need to restrict searches manually - Vista will do it automatically. Docmd Access Visual Basic. However, I want to connect to this query from within Excel as a data source. Professional forum and technical support for computer/IT pros for Microsoft: Access Modules (VBA Coding). MS Access 2010 VBA Storing Query Results in an Array within a Function I am familiar with VBA coding, Access, custom functions, etc. The For loop is typically used to move sequentially through a list of items or numbers. Use the VBA DAO Database Execute command, rather than DoCmd. This resolves two dilemmas: it allows reviewing the estimated execution plan, and it confirms that the query will run successfully. As I said, I have plugged the SQL Statement into the Access SQL query pane and it returns one row, as expected. Using Select Case Statement to populate data in the text boxes automatically when you select the value in the combo box. This article explains a series of tips for crosstab queries. 2 days ago · The optimum outcome is probably a low-cost discretionary service driven by client outcomes, which can respond promptly when things go wrong and which aggressively pursues value for money (in the. This VBA code helps you to download or import Access Table data or Query to Excel in one click. Example in VBA Code: Dim test As Boolean. Here's my code. I’m thinking of doing the donation thing too. While there are multiple methods to do this, one of the most versatile is leveraging SharePoint’s many web services directly via Visual Basic for Applications. The query cannot be used as a row source. Describes how to modify query properties in Microsoft Access. Why is it? You can avoid the process of opening the DB and executing the query manually; this code will execute even from an Excel sheet without opening the Access DB manually. Access 2007: Query to find value in a table and return BOOLEAN I have a value that I'd like to match to a value in table FindingRecords, field F_FindingID. A function can only have one return value. Access VBA create Query Sometimes we don’t want to create Query in Query Design View, because you may create a Query with criteria depending on a variable. From Access 2002 onward, you can not only bind a form by setting the Recordsource of the form to a table or query name or any SQL statement, but you can as well data-bind the form by settings its Recordset property to a Recordset you created in VBA code. ’ this is often an excellent thanks to. Irish health insurer Laya Healthcare Ltd. Re: Excel VBA Userform and Access Norie, I figured it out - mostly. Executes a query with the provided selection and sort criteria, then returns the requested columns. With the below code I'm trying to run a SQL query and return the results in the worksheet 'LLL'. Crosstab query techniques. You use top value queries to answer a variety of business questions, such as which products sell well and which do not. One method is to use DAO programming to access the remote db and simply execute the query. The Invoice date must be after 1st April 2005 and more than 10 days old. For example, if you assign the name myResult to the result attribute, you would retrieve the name of the SQL statement that was executed by accessing #myResult. These records are stored in a so-called recordset. The research I have done goes on about doing far more complex things in Access from an Excel macro, but not how to just run a query. Since these are sequential, you can't return to a previous dialog to change an incorrect value. Sometimes it needs to be run programmatically by access (programmatic query eg using loops). Exporting Access query to Excel using VBA and creating a secondary axis chart VBA Excel to VBA Access. what is it i'm not seeing - could you pleas help. I want to run a parameter query using Access 2016 VBA and then assign the result of a certain column to a variable. By simply referencing the query in my VBA, there is no chance of that happening. Now when the form is submitted, the message is alerted. Apply other criteria to the query. Creating a query in Design View, how does one create a query in the "Condition" field that tells the Access to return the record set where the contents of one column is greater than the other?. This resolves two dilemmas: it allows reviewing the estimated execution plan, and it confirms that the query will run successfully. On the other hand, if you also want all Null values, you must tell Access to also return Null values. How to correctly reference and call a DLL: 19. 7), the data appears in order by first name and then within first name by last name (see Figure 3. I have an MS Access query that contains a parameter. It is possible for the columns to be in different locations every time because the data comes from a query in Access. For instance, suppose you want to return all of the records in a table. In other words, you are "querying" the database for some data that matches a given criteria. Displays a message box that shows the value in cell A1 on Sheet1: : Range « Excel « VBA / Excel / Access / Word. Unfortunately, setting the CurSel field back to zero isn't the problem - that's resetting the table for another iteration of necessary GIS processing. In my VBA code I want to get the result of a query into a variable. When I execute the stored procedure in SQL it correctly returns the NewID field with the identity value of the new record. See this blog post Passing complex arguments with default values in VBA - like jQuery $. A recordset can be described as a kind of table in the server's memory, containing rows of data (records), and each record is subdivided into individual fields (or columns). As a best practice when creating an update query, first create a select query that identifies the records that you want to update, and then convert that query to an update query that you can run to update the records. Execute method (ADO command) 06/08/2017; 2 minutes to read; In this article. Double-click on the query to run it. When the Query Properties window appears, change the "Top Values" property to 6. So streamline your program logic and get the best performance of macros. A base URL is useful for the URL parser. In each case if the database file is "C:\mydb\mydb. You don't need to have this query to return something special as you already do know how many rows were returned (check if your datable, reader or list has 0 elements). Include the primary key in the ORDER BY clause to ensure it can decide which one to return if there are equal values. As I said, I have plugged the SQL Statement into the Access SQL query pane and it returns one row, as expected. Access sorts the data in the query grid from left to right, meaning that if the first name field appears on the query grid before the last name field (see Figure 3. How to retrieve output parameter from Store procedure and get value in vb. Return values from a pass-through query via VBA How to return values from a SQL Server Stored Procedure and. When i change my SQL-string to "Select * from " eigther within VBS or VBA it works fine, but i need to use the sproc. Return Access Form input in Report. How to return multiple values from a VBA function (Part 1) 16. Once the parameter has been supplied, the query can return the results, based on the parameter provided. A Tutorial on Building SQL in VBA. In section 2 you will learn all the VBA vocabulary that is essential to work with business data (accounting, sales, production and others). Most of these examples are fairly standard ANSI-SQL so should work on most relational databases such as PostGreSQL, MySQL, Microsoft SQL Server, Oracle, Microsoft Access. Note: Rather than opening the entire table, we could have used a query to filter the data and return only the values we need. would like to call a stored procedure in my VBA and have the stored procedure return a value. Access commands and functions can be used in the VBA code set to run when form An A-Z Index of Microsoft Access Return the last value from a query. Foreign exchange Leverage Learn how to use the Pip Milking Technique. badgerDB is an embedded key-value store, and badgerhold serves a similar use case however with a higher level interface for common uses of Badger. Microsoft Access Outer Join Query: Finding All Records in One Table but Not Another and Creating "Not In" Queries by Molly Pell, Quality Assurance Specialist. This happens prior to the actual submission, so we can cancel the submit action by calling. 10 tricks for handling null values in. step 1 in modifying accouynts from excel spread sheet. Re: Returning a scalar value from Access query to Excel field in VBA. And if the query returns 1 valid row, the list count is set to 1. If you do this, the changes to the data are inside the scope of the transaction. Execute("select * from employees") Do Until. So how can you run a query in another database? Well, that depends! It depends on whether you simply need to run an action query or if you actually wish to get the results returned to you. Plexian - Autocomplete storage for Java applications. Related Access Database. When the query is run, the user is first prompted to enter a parameter (or multiple parameters). Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window. I am developing an application with an Access frontend and MSSQL backend. Most of these examples are fairly standard ANSI-SQL so should work on most relational databases such as PostGreSQL, MySQL, Microsoft SQL Server, Oracle, Microsoft Access. Answer >> If you design your query using the following criteria, you will be able to query by either a specific value, or leave the parameter box empty to return all records: databasedev. Use wildcards in queries and parameters in Access. A ByRef argument with the Application. For instance, what if you need to find out how many of something exists within your database?. The result returned are in the range -1. If you know the result set has only one row and one column, you can use this method to speed up retrieval of the value. But when I open the pass-through query in Access it creates the new record but doesn't return the identity value. 0;" & _ "Data Source=" & CurrentProject. Hello! I'm using Access and I'm trying to write VBA code to get the value of a specific field from a query. By hiding SQL, application developers are excluding a powerful tool. I have a query that returns all the columns needed and can be filtered by EmployeeID. Some days after that post, I received some e-mail requests about doing the same, but for Access databases. When I execute the stored procedure in SQL it correctly returns the NewID field with the identity value of the new record. This resolves two dilemmas: it allows reviewing the estimated execution plan, and it confirms that the query will run successfully. Insert - Add records to a table (append query). I don’t mean to badmouth WordPress when I sa. Tables and queries are the foundation of any Access database. Excel Formulas, Data, Tables, & VBA Ways to use Excel formulas and data, including worksheet functions, range names, cell references, databases, lookup methods, PivotTables, arrays, and VBA. A Long variable to which the provider returns the number of records that the operation affected. How to return multiple values from a VBA function (Part 3) 14. Access VBA loop through Table records Suppose we have an Acess Table or Query and you want to loop through the records (in Excel terms, to loop the values in each row), we have to make use of Recordset objects, which has different Methods to help us manipulate data in a database at the record level. Once the parameter has been supplied, the query can return the results, based on the parameter provided. This VBA code helps you to run the Access query from any of the VBA supported tools like MS Excel, Word etc. Returns the date values of the field "DateTime" in the Short date format without the time information. If the child row source query returns no rows, the listcount property still is set to 1 in Access 2003. Run the query. The result returned are in the range -1. In our sample table, we have a field that shows the names of employees. 10 tricks for handling null values in. Using Select Case Statement to populate data in the text boxes automatically when you select the value in the combo box. Note: Rather than opening the entire table, we could have used a query to filter the data and return only the values we need. In VBA, you can also use the keyword ByRef to force a parameter to be passed by reference. Next we'll jump back-and-forth between MS SQL Server and MS Access to create identical queries and look at what occurs within the Query Engine in SQL Server to demonstrate the need to use Pass-Through queries when working with MS Access and a non-Jet data engine. As made available by the dialog box in the accompanying figure, a(n) ____ join is a join in which Access selects records from two tables only when the records have the same value in the common field that links the tables. String filename, java. Creating a query in Design View, how does one create a query in the "Condition" field that tells the Access to return the record set where the contents of one column is greater than the other?. I need to set the enabled = False on the child combo box if there are no valid rows from the query. Tables store the data and queries retrieve the data we need to. I start by showing you the Refresh macro command in Access 204. Why is it? You can import Access table data to Excel without even opening the Access DB. The ExecuteScalar method returns the value of the first column of the first row of the result set. Its formatted real well. The code uses ADO and requires a reference to ActiveX Data Objects Library. Execute SQL Query with VBA and fill. One method is to use DAO programming to access the remote db and simply execute the query. We have many examples of procedures throughout our web site and our Total Visual SourceBook program is a commercial library with over 3600 procedures. Access is pretty good about recalculating automatically. Then we’ll open a new query to add to our Collection. Although we often want to find exact matching values, sometimes we wish to search for a pattern within a string or a string which ends a certain way. Maximize the use of TempVars in Access 2007 and 2010 The TempVars collection has the ability to save developers time, improve the reliability of your programming and provide you with new ways to share information across your application. Since Access 97, developers have had the option of globally instructing Access to insert the Option Explicit statement in all new modules. Unless you have entered. 2 days ago · Interns have an opportunity to contribute to projects overseen by Blacksheep Regenerative Resource Management, which processes rainforest crops like turmeric and cacao into value-added products, and grants international market access to a number of small farms across Costa Rica. i set up a data transfer from access gt excel using vba the access query i use the following instruction set pres. Hello, I am new to VBA and have successfully got some VBA code in Excel to open and access a parameter query in Access 2003. Here's what the query looks like in the query designer:. The meaning is the same meaning for mathematic operator. All queries and tables are within the same. I have been searching for days and haven’t been able to find a post close to answering this question. Consider creating a handful of data-access functions/subs where you can simply run an UPDATE statement, or retrieve a single value, or retreive a full blown recordset. Solution:. Create a DLL by CSharp or VB. Count property returns the number of cells in a. I have an Access 2003/XP/2000/97 database that contains a form called Orders. 1 has been released! Codenamed "Business as Usual", 3. Return a string containing the values of related records. Its an incredible often untapped tool underestimated by many users! Using MS Query in Excel you can extract data from various sources such as: Excel Files – you can extract data from External Excel files as well as run a SELECT query on your current Workbook. I start by showing you the Refresh macro command in Access 204. Sometimes it needs to be run programmatically by access (programmatic query eg using loops). For example, a reference to a control on an open form will be evaluated automatically, and the query containing that parameter will use the value contained in that control. Maximize the use of TempVars in Access 2007 and 2010 The TempVars collection has the ability to save developers time, improve the reliability of your programming and provide you with new ways to share information across your application. These functions all work whether the database is opened via a local drive, mapped drive or a UNC path. Learn More Using Knowledge Exchange™ , store valuable company content, including videos, articles, training materials, and more. Returns a Recordset object reference or Nothing. Queries: Use a parameter to return all records if Null. You use top value queries to answer a variety of business questions, such as which products sell well and which do not. RunSQL(sql_goes. Step3: Then run Update Query to update the ErrorMessage from Access to post to the Sql Query for the newly created EventID. The query returns a single employee record using EmployeeID as criteria. With access to the net, you'll be able to really play the exchange – with faux cash – to induce a compassionate however it works. When querying data from multiple tables in Microsoft Access or SQL Server, we usually use Inner Joins to link records with values that exist in both tables. Execute method (ADO command) 06/08/2017; 2 minutes to read; In this article. Dlookup is one of the best tools for creating user friendly Access forms. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under  Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: