Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Controlling Processes

Posted on 2003-02-25
3
Medium Priority
?
131 Views
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
        DoEvents
        objDeposits.PrintDepositDetails lvBatches
        objDeposits.ChangeDepositStatus
        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?
0
Comment
Question by:zdpl0a
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
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
       DoEvents
       objDeposits.PrintDepositDetails lvBatches
       While Not objDeposits.DonePrintingDeposit
           DoEvents
       Loop
       objDeposits.ChangeDepositStatus
       Set objDeposits = Nothing
0
 

Author Comment

by:zdpl0a
ID: 8307065
Thanks da weasel .. works like a champ ..
0
 
LVL 3

Expert Comment

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

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 Month10 days, 22 hours left to enroll

572 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