Home Page Google Tips Quickbooks Tips Other Tips Peachtree Accounting DDE Tips Peachtree Accounting Tips Microsoft Excel Tips Our Store Site Map Training Recent Projects Our Services Home Page
Accounting Advisors Logo Navigation Bar
 
Quick Links
- Learn How We Can Help
- Read About Recent Projects
- Schedule a Class
- Pay Your Invoice Online
- Request Technical Support

Free Newsletter
You'll receive Peachtree tips, Excel tips, and more!

Newsletter Archives
Privacy Policy
Did you know?
We offer technical support for Peachtree Accounting, Microsoft Excel, and DDE by e-mail, telephone, or remotely.
Double Line Bar   Source Code Paw Com General Tips Our View of DDE
Peachtree Accounting DDE
Using DDE with Microsoft Access
David Nemec successfully integrated Peachtree Accounting and Access via DDE. We thank him for contributing the following routine to our web site:
Warning! Code may be wrapped!

'
*************************************************************
' Declare these in a Declaration section of a standard module

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const wm_close = &H10
Private Const msgtitle As String = "peachtree accounting: companyname"
*************************************************************

Private Sub PostToPeachtree()
Dim mystring As String
dim mydate as date
Dim db As Database
Dim rs As Recordset
Dim hwnd As Long

Set db = CurrentDb()
Set rs = db.OpenRecordset("test")
mydate = inputbox("Enter Posting Date")

channelnum = DDEInitiate("peachw", "companyname")
DDEPoke channelnum, "file=generaljournal,CLEAR", ""
DDEPoke channelnum, "file=generaljournal,field=date", mydate

rs.MoveFirst
DDEPoke channelnum, "file=generaljournal,field=firstdistribution", rs!acct & Chr$(9) & rs!amount & Chr$(9) & "" & Chr$(9) & ""
rs.movenext
Do Until rs.EOF
DDEPoke channelnum, "file=generaljournal,field=nextdistribution", rs!acct & Chr$(9) & rs!amount & Chr$(9) & "" & Chr$(9) & ""
rs.MoveNext
Loop
rs.Close
DDEPoke channelnum, "file=generaljournal,SAVE", ""
DDETerminateAll
MsgBox ("Transactions Posted to Peachtree")

' *******************Close Peachtree Window
hwnd = FindWindow(vbNullString, msgtitle)
Call SendMessage(hwnd, wm_close, 0, ByVal 0&)
End Sub

David Nemec comments on his code:
[Above] is the code I used which retreives values out of a table in a Custom Access App and pokes them into the General Journal file in Peachtree. Keep in mind that the transaction must balance in order for Peachtree to save it and the code at the bottom closes the Peachtree window.

Did you know that there's an alternative to DDE?

PawCOM not only eliminates the need for DDE, it also gives you access to all of the underlying tables in Peachtree, not just the selective availability offered by DDE. This ActiveX control offers both read and write access to Peachtree, and is compatible with Peachtree Accounting and Complete Accounting for Windows version 7 or later.
Plus, the DLL file can be distributed with your applications royalty-free!

Click Here to Learn More or Purchase PawCOM Now!

Accounting Advisors, Inc.
614 Park Avenue SE
Atlanta, Georgia 30312
Telephone: 404-784-0275
Toll Free: 800-724-0315
Fax: 404-420-2175
Privacy Policy


[Home Page] [Our Services] [Recent Projects] [Training] [Support]
Tips: [Excel] [Peachtree] [Quickbooks] [Google] [DDE] [Other]
[Pay Your Invoice] [Driving Directions] [Site Index]

Valid HTML 4.01!
Valid CSS!
About Our Site

Left Footer
Questions? Comments?
Email Us
or call (404) 784-0275
Our toll free number is (800) 724-0315
© Copyright 2004 by Accounting Advisors
Web site designed and maintained by Accounting Advisors, Inc.
Right Footer