[QODBC-ALL] Using QuickBooks Data with VBA
Posted by Rajendra Dewani (QODBC Support) on 17 June 2014 07:37 AM
Using QuickBooks Data with VBA
For 64 Bit, Please refer: How to Configure QODBC to Work With 64-bit MS Access
Everything almost worked perfectly with the installation and linking to MS Access 2010 and QuickBooks Pro11. The tables I needed were linked to my database in Access. However, my question is how do I update (or can I update) QuickBooks using a form (linked to my tables downloaded to Access Form using QODBC )in MS Access?
You can insert/update/delete records through access local table you need to write VBA script to perform the SQL operation or Can execute existing Queries Or can link the form to the existing table.
Please refer below steps which contain a sample tutorial for How QODBC can work with VBA. The tutorial is for sample reference only for further requirements you need to develop a form or write scripts which will fetch data from a local access table perform the insert operation in QuickBooks using QODBC.
Creating a Form in Microsoft Access:
Note: Microsoft Access is a product with many uses, and will allow you to use your QuickBooks Data files in the same fashion as Access databases.
Open MS Access, you can find it via Windows Start->All Programs->Microsoft Office:
A default database file name Database1 appears in the box. You can edit this to a more relevant name, such as QB Link.accdb. Save the file as type "Microsoft Office Access Databases".
Then Click "Create" to create a blank database:
After the new database is created, Create a New Form via "Form Design" link in Create Tab:
After the new form is created, Insert a button in the form:
Rename button as per your requirement (In this example button name is "Select Customer"):
Now go to button property window and set the property for "On Click" event select "Event Procedure" from dropdown list then click on "..." button:
The new window is open which contains VBA code (In this example it contains code button click event):
Now Insert module in the form by Right clicking on the form:
Write code in the module (In this example I am writing code for selection of customer name):
Link newly created module with button click event:
Now click on "Select Customer" button, you will get Name of all customer:
By repeating above steps, you can add functionality in your VBA code as per your requirement. In this example I have added functionality for Insert, Update & Delete of customer record:
By clicking on "Insert Customer" button, the New customer is added with the name "Testing VB":
By clicking on "Update Customer" button, Newly added customer name is updated with the name "Updated Testing VB":
By clicking on "Delete Customer" button, Newly added customer is deleted:
Please refer below code which is used in this example:
Public Sub exampleSelect()
Public Sub exampleInsert()
Public Sub exampleUpdate()
Public Sub exampleDelete()