Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

log onto AccPac with previous days date via VB .NET code

Status
Not open for further replies.

SMI168

Programmer
Sep 29, 2009
18
ZA
Hi Guys, I need to insert GL transactions into AccPac but for yesterdays date and period. Since the month has changed (01/07/2010) AccPac by default displays the new months date and period. If i physically change the session date to 30/06/2010 when i open up AccPac, the default date in the GL Entry screen is 30/06/2010. How do I code my VB .NET app to pass through yesterdays date. My Session Initialise code looks like this :

session.Init("", "", "", "")
session.Open("", "", "", System.DateTime.Now, 0)

Instead of 'System.DateTime.Now' What can i use for the session to reflect yesterdays date?

thanks...
 
Hi There, the System.DateTime-1 doesnt seem to work, but i've tried:
session.Open("", "", "", "2010 - 6 - 30", 0)
and this has worked perfectly.

Thank for the reply, its much appreciated...
 
There must be some VB.Net date decrementing function you can use. In VB6 you just subtract days as integers.
 
session.Init("", "", "", "")
session.Open("", "", "", Now.AddDays(-1), 0)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top