Print Page | Close Window

UpdateWStatus.mdb (intermediate)

Printed From: Roger's Access Library
Category: Roger's Access Library
Forum Name: Roger's Download Samples
Forum Description: A compendium of Microsoft Access 97 and 2000+ routines, each separated into its own sample database.
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=223
Printed Date: 28 Mar 2024 at 5:40pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: UpdateWStatus.mdb (intermediate)
Posted By: Roger Carlson
Subject: UpdateWStatus.mdb (intermediate)
Date Posted: 15 Jul 2008 at 11:20pm

 Please consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm - 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.

Download
Access 97 (45 KB):
http://www.rogersaccesslibrary.com/forum/uploads/5/UpdateWStatus97.zip - UpdateWStatus97.zip
Access 2000 DAO (63 KB): http://www.rogersaccesslibrary.com/forum/uploads/5/UpdateWStatus2k.zip - UpdateWStatus2k.zip



-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net