This page describes the various user functions available within QuickBooks Link (qblink.accde). To see these functions used in code, see the Northwind Demo Application.
Included Functions by Group
Included Functions by Name
qbUpdateCustomersQuickBooks(ByVal binUpdateOnly As Boolean) As Boolean
This function pulls all the customers from QuickBooks into the table tblQBCustomers.
- If binUpdateOnly is True, then it only pulls the customers added since the last update.
- If binUpdateOnly is False, then all Customers in the table tblQBCustomers have binActive
set to False before pulling each customer and matching records are updated
with the latest information. This allows the calling application to detect
deleted Customers but retain all the Customer information.
qbCustomerPullOneById(ByVal strListId As String, ByVal lngCompanyId As Long, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function pulls one customer record from QuickBooks into the table tblQBCustomers.
- If there is already a corresponding record in
tblQBCustomers, the record is updated. Otherwise, the record is added.
Since the calling application will not know the ListId until after a
Customer has been pulled from QuickBooks, the record in tblQBCustomers is
always updated unless the calling application deletes the record, which is
not recommended.
- strListId is the QuickBooks ListId for the desired Customer. This can be retrieved from tblQBCustomers.
- lngCompanyId is the unique Id of the corresponding Company / Customer in the application. This gets stored with
the record in tblQBCustomers to create a one-to-one link between the QuickBooks Customer record and the application Company / Customer record.
- binShowStatus – if true, the Status Bar is set when the customer is being retrieved.
qbCustomerPushIntoQuickBooks(ByRef qbCustomerAdd As clsQBCustomerAdd, ByVal strQBCustomerListId As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function pushes one customer into QuickBooks.
- qbCustomerAdd is a clsQBCustomerAdd class containing all the information about the Customer.
- strQBCustomerListId is the retuned QuickBooks ListId (unique Id) of the Customer just added.
- binShowStatus – if true, the Status Bar is set when the customer is being pushed.
qbCustomerModify(ByRef qbCustomerAdd As clsQBCustomerAdd, ByRef strQBCustomerListId As String, ByRef binEditSequenceError As Boolean, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function modifies and existing customer in QuickBooks.
- qbCustomerAdd is a clsQBCustomerAdd class containing all the information about the Customer.
- strQBCustomerListId is the retuned QuickBooks ListId (unique Id) of the Customer just added.
- binEditSequenceError is True if the Customer cannot be modified because of an Edit Sequence Error. This typically occurs when a customer is manually edited in QuickBooks. The clsQbCustomerAdd
EditSequence must be set to the current Edit Sequence. See the Northwind Demo Application for an example of modifying customers.
- binShowStatus – if true, the Status Bar is set when the customer is being pushed.
qbUpdateVendorsQuickBooks(ByVal binUpdateOnly As Boolean) As Boolean
qbVendorPullOneById(ByVal strListId As String, ByVal lngCompanyId As Long, Optional ByVal binShowStatus As Boolean = True) As Boolean
qbVendorPushIntoQuickBooks(ByRef qbVendorAdd As clsQBVendorAdd, ByRef strQBVendorListId As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
qbVendorModify(ByRef qbVendorAdd As clsQBVendorAdd, ByRef strQBVendorListId As String, ByRef binEditSequenceError As Boolean, Optional ByVal binShowStatus As Boolean = True) As Boolean
These four functions correspond to the Customer functions of the same name, except these are used for Vendors.
qbInvoicePushIntoQuickBooks(ByRef invInvoice As clsQBInvoice, ByRef strQBInvoiceListId As String, ByRef strQBInvoiceTxnId As String, byval curDeposit as Currency, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function pushes an Invoice into QuickBooks.
- invInvoice is a clsQBInvoice class containing all the information about the Invoice.
- strQBInvoiceListId is the returned QuickBooks ListId (unique Id) of the Invoice just added.
- strQBInvoiceTxnId is the Transaction IdSpan2 of the Invoice just added
- binShowStatus – if true, the Status Bar is set when the invoice is being pushed.
- All pushed Invoices are logged to the table tblQBInvoiceLog
qbInvoiceDelete(ByVal lngCompanyId As Long, ByVal strCompany As String, ByVal strQBTxdIn As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function is used to delete an invoice.
- lngCompanyId is the unique Id of the Customer / Company within the application. It is used for logging to
tblQBActivityLog only.
- strCompany is the Customer / Company within the application. It is used for logging to tblQBActivityLog only.
- strQBTxdIn is the Transaction IdSpan3 of the Invoice to be deleted. This can be retrieved from tblQBInvoiceLog or
stored separately after the call to qbInvoicePushIntoQuickBooks
or qbInvoicePullRange.
- binShowStatus – if true, the Status Bar is set when the invoice is being deleted.
qbInvoicePullRange(ByVal datFrom As Date, ByVal datTo As Date) As Boolean
This function pulls Invoices and Invoice Lines into the tables tblQBInvoices and tblQBInvoiceLines.
- datFrom is the date at the low end of the date range of invoices to pull.
- datTo is the date at the high end of the date range of invoices to pull.
- tblQBInvoices and tblQBInvoiceLines are cleared at the start of pulling the Invoices, so only the Invoices within the
range are in the table after each call to this function.
qbInvoiceModify(ByRef invInvoice As clsQBInvoice, ByRef binEditSequenceError As Boolean, Optional ByVal binShowStatus = True ) As Boolean
This function modifies an existing Invoice in QuickBooks.
- invInvoice is a clsQBInvoice class containing all the information about the Invoice.
- binEditSequenceError is True if the Invoice cannot be modified because of an Edit Sequence Error. This typically occurs when an invoice is manually edited in QuickBooks. The clsQBInvoice
EditSequence must be set to the current Edit Sequence. See the Northwind Demo Application for an example of modifying invoices.
- binShowStatus – if true, the Status Bar is set when the invoice is being modified.
- All modified Invoices are logged in the table tblQBInvoiceLog
qbPaymentPushIntoQuickBooks(ByRef qbPayment As clsQbPayment, ByRef strQBPaymentListId As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function pushes a payment into QuickBooks.
- qbPayment is a clsQbPayment class (defined below) containing all the information about the Payment.
- strQBPaymentListId is the retuned QuickBooks ListId (unique IdSpan4) of the Payment just added.
- binShowStatus – if true, the Status Bar is set when the payment is being pushed.
qbPaymentDelete(ByVal lngCompanyId As Long, ByVal strCompany As String, ByVal strQBTxdIn As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
This function is used to delete a payment.
- lngCompanyId is the unique Id of the Customer / Company within the application. It is used for logging to tblQBActivityLog only.
- strCompany is the Customer / Company within the application. It is used for logging to tblQBActivityLog only.
- strQBTxdIn is the Transaction Id of the Payment to be deleted. This can be retrieved from tblQBPaymentLog
- binShowStatus – if true, the Status Bar is set when the payment is being deleted.
qbCreditMemoPushIntoQuickBooks (ByRef cmCreditMemo As clsQBInvoice, ByRef strQBInvoiceListId As String, ByRef strQBInvoiceTxnId As String, Optional ByVal binShowStatus = True) As Boolean
qbCreditMemoDelete (ByVal lngCompanyId As Long, ByVal strCompany As String, ByVal strQBTxdIn As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
These functions correspond to the Invoice functions of the same name, except these are used for Vendor Bills.
qbBillPushIntoQuickBooks (ByRef bBill As clsQbBill, ByRef strQbRefNumber As String, ByRef strQbBillTxnId As String, Optional ByVal binShowStatus = True) As Boolean
qbBillModify(ByRef bBill As clsQbBill, ByRef binEditSequenceError As Boolean, Optional ByVal binShowStatus = True) As Boolean
qbBillDelete(ByVal lngVendorId As Long, ByVal strVendor As String, ByVal strQBTxnID As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
qbBillPullOneById(ByVal strBillListId As String, ByRef binMissing As Boolean) As Boolean
qbBillPullRange(ByVal datFrom As Date, ByVal datTo As Date) As Boolean
These functions correspond to the Invoice functions of the same name, except these are used for Bills.
qbPurchaseOrderPushIntoQuickBooks (ByRef poPurchaseOrder As clsQbPurchaseOrder, ByRef strQbRefNumber As String, ByRef strQbPurchaseOrderTxnId As String, Optional ByVal binShowStatus = True) As Boolean
qbPurchaseOrderModify(ByRef poPurchaseOrder As clsQbPurchaseOrder, ByRef binEditSequenceError As Boolean, Optional ByVal binShowStatus = True) As Boolean
qbPurchaseOrderDelete(ByVal lngVendorId As Long, ByVal strVendor As String, ByVal strQBTxnID As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
qbPurchaseOrderPullOneById(ByVal strPurchaseOrderListId As String, ByRef binMissing As Boolean) As Boolean
qbPurchaseOrderPullRange(ByVal datFrom As Date, ByVal datTo As Date) As Boolean
These functions correspond to the Invoice functions of the same name, except these are used for Purchase Orders.
qbSalesReceiptPushIntoQuickBooks (ByRef srSalesReceipt As clsQbSalesReceipt, ByRef strQbRefNumber As String, ByRef strQbSalesReceiptTxnId As String, Optional ByVal binShowStatus = True) As Boolean
qbSalesReceiptModify(ByRef srSalesReceipt As clsQbSalesReceipt, ByRef binEditSequenceError As Boolean, Optional ByVal binShowStatus = True) As Boolean
qbSalesReceiptDelete(ByVal lngVendorId As Long, ByVal strVendor As String, ByVal strQBTxnID As String, Optional ByVal binShowStatus As Boolean = True) As Boolean
qbSalesReceiptPullOneById(ByVal strSalesReceiptListId As String, ByRef binMissing As Boolean) As Boolean
qbSalesReceiptPullRange(ByVal datFrom As Date, ByVal datTo As Date) As Boolean
These functions correspond to the Invoice functions of the same name, except these are used for Sales Receipts.
qbClassPushIntoQuickBooks(ByRef qbClassAdd As clsQbClassAdd, ByRef strQBClassListId As String, Optional ByVal binShowStatus = True) As Boolean
This function pushes a Class into QuickBooks.
- qbClassAdd is a clsQbClassAdd class containing all the information about the Class.
- strQBClassListId is the retuned QuickBooks ListId (unique Id) of the Class just added.
- binShowStatus – if true, the Status Bar is set when the Class is being pushed.
qbPaymentMethodPushIntoQuickBooks(ByRef qbPaymentMethodAdd As clsQBPaymentMethodAdd, ByVal lngPaymentTypeId As Long, ByRef strQBPaymentMethodListId As String, Optional ByVal binShowStatus = True) As Boolean
This function pushes a Payment Method into QuickBooks.
- qbPaymentMethodAdd is a clsQBPaymentMethodAdd class (defined below) containing all the information about the Payment Method.
- lngPaymentTypeId is a Payment Method Id for logging.
- strQBPaymentMethodListId is the retuned QuickBooks ListId (unique Id) of the Payment Method just added.
- binShowStatus – if true, the Status Bar is set when the Payment Method is being pushed.
qbSalesTaxPushIntoQuickBooks(ByRef qbSalesTaxAdd As clsQbSalesTaxAdd, ByRef strQBSalesTaxListId As String, Optional ByVal binShowStatus = True) As Boolean
This function pushes a Sales Tax Code into QuickBooks.
- qbSalesTaxAdd is a clsQbSalesTaxAdd containing all the information about the Sales Tax Code.
- strQBSalesTaxListId is the returned QuickBooks ListId (unique Id) of the Sales Tax Code just added.
- binShowStatus – if true, the Status Bar is set when the Sales Tax Code is being pushed.
mapqbQuickBooksIsOpen()
This function returns true if QuickBooks Pro 201x or QuickBooks Enterprise is open. It does NOT check if the correct QuickBooks Company file is open.
logRaiseErrorQb(ByVal binSuccess As Boolean)
If the value passed to this function is true, it does nothing. If the value passed is false, it raises an error to be handled at the level of the calling function. This
allows avoiding If (binSuccess) Then ... End If for calls that are not likely to generate an error.
This function opens a connection to the QuickBooks Company file in tblQbSetup with binCurrent = True. Note: Call qbConnectionOpen before bulk transactions, and be sure to call
qbConnectionClose after all transactions or any errors. If you are only doing a single transaction, for instance, pushing one invoice, it is not necessary to call qbConnectionOpen first. By explicitly
opening the connection, the connection to QuickBooks is only opened once, instead of once per transaction.
This function closes the open connection to the QuickBooks Company file.