UpdateWStatus.mdb (intermediate) |
Post Reply |
Author | |
Roger Carlson
Microsoft MVP Joined: 20 Feb 2008 Status: Offline Points: 261 |
Post Options
Thanks(0)
Posted: 15 Jul 2008 at 11:20pm |
Please consider donating $1 per sample downloaded, find out why here. UpdateWStatus.mdb
This database illustrates two things: 1) How to update a table programmatically with values from another table and 2) how to implement a pop-up status meter.
Update: there are two tables, "Shoes" and "ShoeImport". The module "Import" compares each record from ShoeImport with the Shoes table. If the record exists, it updates the record, if it does not, it adds a new record. Status Meter: I did not originate the status meter. It comes from a book called "Microsoft Access 2.0 How-To CD" by Ken Getz. The code for the status meter is in the module "basStatusMeter". The functions are called from the Import module. Calls for the status meter can be identified by the "aht" prefix. Status meters can be difficult to illustrate unless you have a long process to use it with. In this case, the meter is used by calculating the how many records constitute 1% of the total records to be processed (total records / ((total records/100)+1). Every time that many records are processed, the status meter is updated by another 1%. The over all process is to: 1) Initialize the status meter (ahtInitMeter), 2) update the meter throughout your process (ahtUpdateMeter) and then 3) close the meter (ahtCloseMeter). To use this in your own database, copy the module (basStatusMeter) into your database and then call the various subs in your code. Note: The call for ahtInitMeter has a True/False argument. If you set it to True, put a DoEvents line in your code to be able to cancel the process. If you set it to False, do not put the DoEvents line in. DownloadAccess 97 (45 KB): UpdateWStatus97.zip Access 2000 DAO (63 KB): UpdateWStatus2k.zip |
|
|
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |