Solved

Progress bar for Access 97

Posted on 2001-08-14
10
1,147 Views
Last Modified: 2011-09-20
Is there some "standard" way of providing progress bar for Access 97? Is there some ActiveX control that is present on all Windows systems (or at least on Windows 98)?

I'm working on project that has to work on Access 97 and Access 2000. I develop it in 2000 and then "downgrade" it to 97 to have both versions. I made "great" window with progress bar and used it, but when ported it to 97, it doesn't work. Access doesn't recognize and properties that ActiveX control exposes (Min, Max, Value).

So... any "standard" progress bar control that would work also on Access 97?
0
Comment
Question by:DejanK
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 3

Expert Comment

by:Diveblue
ID: 6386174
in access 97..you can use the application's progress bar

You can use the SysCmd function to perform one of the following functions:

?     Display a progress meter or optional specified text in the status bar.
?     Return information about Microsoft Access and its associated files.
?     Return the state of a specified database object to indicate whether the object is open, is a new object, or has been changed but not saved.

For example, if you are building a custom wizard that creates a new form, you can use the SysCmd function to display a progress meter indicating the progress of your wizard as it constructs the form.

Syntax

ReturnValue = SysCmd(action[, text][, value])
ObjectState = SysCmd(action[, objecttype][, objectname])

The SysCmd function has the following arguments.

Argument     Description
action               One of the following intrinsic constants
                  identifying the type of action to take.


The following set of constants applies to a progress meter. The SysCmd function returns a Null if these actions are successful. Otherwise, Microsoft Access generates a run-time error.


acSysCmdInitMeter     Initializes the progress meter.  
                        You must specify the text and
                        value arguments when you use this
                        action.
acSysCmdUpdateMeter:
     Updates the progress meter with the specified value. You must specify the text argument when you use this action.

acSysCmdRemoveMeter
     Removes the progress meter.

acSysCmdSetStatus    
Sets the status bar text to the text argument.

acSysCmdClearStatus      
Resets the status bar text.

0
 
LVL 1

Expert Comment

by:shageman
ID: 6386177
0
 
LVL 1

Expert Comment

by:shageman
ID: 6386180
Sorry DiveBlue....got in just after you
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:DejanK
ID: 6386267
Thanks for fast reply!

I tested this SysCmd progress bar, but ... I don't like it. It is too small, too hidden. I want a progress bar on my form (pop-up form), so user clearly sees it has to wait.

Could I use some API or standard control that is available on most systems to get progress bar on my form? Only requirement is that is has to work on Access 97 AND Access 2000.
0
 
LVL 2

Expert Comment

by:Gudare
ID: 6386277
Only thing I can think of that's truly default is to use a form that's modal, create it with a bunch of hidden labels/images/whatever, and unhide them as part of your code, depending on where it thinks it's supposed to do this. Pretty? Um, no. But only item I can think of that you're garuanteed to work cross platform no matter the install type of 97/2k (they can leave out active x controls, so on...).

Or, create a runtime version of the DB, meaning you have the Office Developers Toolkit (name's probably off, I don't have it here.)

-Craig
0
 

Author Comment

by:DejanK
ID: 6386486
I did some more testing with control I currently use (Microsoft ProgressBar (from comctl32.ocx)).
If I put control on form in Access 2000 and then downgrade (save as previous version) to Access 97, control doesn't work anymore. If I add same control to this converted form, it works. So... I can have two controls of same type on same form, but they behave differently. Both has "Ole Class" and "Class" properties the same (Ole Class: ProgCtrl  Class: COMCTL.ProgCtrl.1), but "Other" tab in properties window is different. One (the one that was added in 97) has all properties in it (Min, Max,...), other (the one that was "downgraded" from 2000) has only few - and none is specific to this control.

Comctl32.ocx (or mscomctl.ocx) is standard windows component, but looks like I can't use it in my case. Is there a way to use it using APIs? Or any way to get around my problem?
0
 
LVL 3

Accepted Solution

by:
Diveblue earned 50 total points
ID: 6386792
0
 
LVL 57
ID: 6388390
If that doesn't work, hop over to www.fmsinc.com.  They have a componet collection that includes a progress bar.

Jim.
0
 

Author Comment

by:DejanK
ID: 6389212
Diveblue,
I like your link (Creating a Common Control Progress Bar via API) :)
I tested it and found it working. Mostly.

CreateWindowEx needs parameter hInstance. How to get it in Access?

From MSDN:
hInstance
Windows 95/98/Me: [in] Handle to the instance of the module to be associated with the window.
Windows NT/2000 or later: This value is ignored.

I'm developing on W2000, so everyhing works, but end-users are using W98.

Another more serious problem: this code shows progress bar without 3D border (actually without border at all) in Access. In VB (not VBA) it works fine. That wouldn't be a problem, but ... if there is no border, there is no visual limit, so users can't know how far progress bar will go. That looks just like if I would show numbers (but not percent) starting at 0 and increase them... but noone could know when they will stop (at 10, 100 or 1000?).

I tried to change Style and ExStyle of progress bar window (at create time and later with SetWindowLong), but with no effect. If I "ask" for value (GetWindowLong), it returns value as if border would be shown.

I guess that could be problem with Access and its repainting mechanism but... I tried to .refresh window, to call UpdateWindow API on form and/or progress bar, but again with no effect.
It just doesn't want to show border.

Another possibility I thought of is to manually (with API) draw border. I don't know how... can't find appropriate API. I also can't use Access's rectangle control, since I can't get compatible position coordinates (twips, pixels).

Problems are same in Access 2000 and 97.

Any ideas?
0
 

Author Comment

by:DejanK
ID: 6420825
I used solution you provided, even if it doesn't work perfectly. That's why I'm giving B.
Thanks for help!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

815 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now