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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Posting GL Batches

Status
Not open for further replies.

nevillestoke

Vendor
Aug 11, 2005
3
CA
I have a macro that posts unposted batches individually, as I do not want to have many batches posted with one posting sequence number. What I am trying to obtain is a pause in the macro that allows me to enter (or even select) the first and last batch number to be posted. I may not wish to post all batches, so I need the flexibility for a start and end point.

A portion of the VBA code is listed below. I am using Accpac SM and GL V5.4 using SQL in a Windows XP environment.

Dim GLPOST2 As AccpacCOMAPI.AccpacView
Dim GLPOST2Fields As AccpacCOMAPI.AccpacViewFields
mDBLinkCmpRW.OpenView "GL0030", GLPOST2
Set GLPOST2Fields = GLPOST2.Fields
'*************************************************************************
' Starting range of batches is I =
' Ending batch is on While statement
'*************************************************************************
Dim ICount As Double

ICount = 149337
Do While ICount <= 150057
GLBATCH1batchFields("BATCHID").Value = ICount ' Batch Number
GLBATCH1batch.Read
If GLBATCH1batchFields("BATCHSTAT").Value = 1 Then
GLBATCH1batchFields("RDYTOPOST").Value = "1" ' Ready to Post
GLBATCH1batch.Update
GLPOST2Fields("BATCHIDFR").PutWithoutVerification ICount ' From Batch Number
GLPOST2Fields("BATCHIDTO").PutWithoutVerification ICount ' To Batch Number
GLPOST2.Process
End If
ICount = ICount + 1
Loop

MsgBox "Post completed"

Exit Sub

ACCPACErrorHandler:
Dim lCount As Long
Dim lIndex As Long
 
Or you can use the InputBox function. But a form would be nicer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top