Controlling Processes

Posted on 2003-02-25
Medium Priority
Last Modified: 2010-05-01
Hello Experts:

I need help determining how to handle this process.  I have a report, which displays information concerning transactions on a deposit slip.  After running the report, I run a seperate routine, which changes the status of each record to indicate that that transaction is closed.  This process works just fine.

However, it appears that the status changing occurs first, so when the report is displayed, it returns a blank report.  I've put the processes in a module, and call the module from my application.  Here is the code:

        Dim objDeposits     As clsStatements
        Set objDeposits = New clsStatements
        objDeposits.PrintDepositDetails lvBatches
        Set objDeposits = Nothing

PrintDepositDetails is the module which displays the report and ChangeDepositStatus is the module which changes the status of each transaction.  So, my question is, is there a way to determine when a process is completed before starting the next process?
Question by:zdpl0a
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Da_Weasel earned 200 total points
ID: 8021260
You need to add a Property to your Deposit object called DonePrintingDeposit to signal when the PrintDepositDetails is done.
inside the 'PrintDepositDetails' Method set 'DonePrintingDeposit' equal to FALSE at the beginning of the procedure, and set 'DonePrintingDeposit' to TRUE at end of the procedure.

Then use the object like this:

       Dim objDeposits     As clsStatements
       Set objDeposits = New clsStatements
       objDeposits.PrintDepositDetails lvBatches
       While Not objDeposits.DonePrintingDeposit
       Set objDeposits = Nothing

Author Comment

ID: 8307065
Thanks da weasel .. works like a champ ..

Expert Comment

ID: 8314914
There are better ways of doing this with events and such, but this is the easiest way that works in most situations.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question