I have a .dbf file that I would like to export to quickbook specifically my invoice.dbf file. Is this possible? Can anybody please tell me how to do it?
A QuickBooks import file is simply a tab-delimited text file with an .IIF extension. In the simplest terms, all you have to do is create the file and then import it into QuickBooks.
Step 1: Create the Import File
In your VFP application, write the necessary code to build a text file in format that matches the specifications for the version of QuickBooks you are targeting. Give it any name you like, but use an .IIF extension so QuickBooks will recognize it. An example of such a file is provided later in this document.
Step 2: Import it into QuickBooks
In QuickBooks, go to the File menu and chose Import. In the Open File dialog, select the file you created in Step 1 and click Open. QuickBooks will import the records in this file.
Sample Code courtesy of Rick Borup:
* Abstract..: Create a QuickBooks transaction import file for invoices.
* Create the export file, bail out with an error msg if unable to create it.
LOCAL lcExpName, lnFileNo
lcExpName = "myQBFile.IIF"
lnFileNo = FCREATE( lcExpName, 0) && Create and open for Read/Write.
IF lnFileNo < 0 && -1 means error, couldn't create the file.
??CHR(7)
WAIT WINDOW NOWAIT ;
"Error: Can't open file " + lcExpName + CHR(13) + ;
"The QuickBooks 2000 batch file could not be created."
RETURN
ENDIF
LOCAL lcHdrRec, lcSplitRec, lcEndRec, lcTab
lcTab = chr(9)
* Write the three header records.
=FPUTS( lnFileNo, lcHdrRec) && the !TRNS header record
=FPUTS( lnFileNo, lcSplitRec) && the !SPL header record
=FPUTS( lnFileNo, lcEndRec) && the !ENDTRNS record
* Now, scan the INVOICES table and write a set of three records
* to the export file for each invoice for the specified date.
SELECT invoices
GO TOP
SCAN FOR invoices.invdate = ldDate
* Set the value of the variable fields
lcCustNo = UPPER( ALLTRIM( invoices.custno))
lcDocNo = ALLTRIM( invoices.invoiceno)
lcShipDate = DTOC( invoices.shipdate)
lcPlusAmt = ALLTRIM( STR( invoices.invamt, 13, 2))
lcMinusAmt = "-" + lcPlusAmt
* Set the value of the columns for the transaction record
lcTRNS = "TRNS"
lcTRNSID = ""
lcTRNSTYP = "INVOICE"
lcDATE = lcShipDate
lcACCNT = "Accounts Receivable"
lcNAME = lcCustNo
lcCLASS = ""
lcAMOUNT = lcPlusAmt
lcDOCNUM = lcDocNo
lcMEMO = ""
lcCLEAR = "N"
lcTOPRINT = "Y"
lcADDR1 = ""
lcADDR2 = ""
lcADDR3 = ""
lcADDR4 = ""
lcADDR5 = ""
lcDUEDATE = ""
lcTERMS = "Net 10 Days"
lcPAID = "N"
lcShipDate = lcShipDate
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.