UpdateWStatus.mdb (intermediate)

Please consider donating $1 per sample downloaded, find out why here
Access 97 (45 KB)

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.




Need Winzip?

Return to Main Page