Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1230
  • Last Modified:

Progress bar for Access 97

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
DejanK
Asked:
DejanK
  • 4
  • 2
  • 2
  • +2
1 Solution
 
DiveblueCommented:
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
 
shagemanCommented:
0
 
shagemanCommented:
Sorry DiveBlue....got in just after you
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
DejanKAuthor Commented:
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
 
GudareCommented:
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
 
DejanKAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
If that doesn't work, hop over to www.fmsinc.com.  They have a componet collection that includes a progress bar.

Jim.
0
 
DejanKAuthor Commented:
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
 
DejanKAuthor Commented:
I used solution you provided, even if it doesn't work perfectly. That's why I'm giving B.
Thanks for help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now