nevillestoke
Vendor
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
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