Solved

Progress bar for Access 97

Posted on 2001-08-14
10
1,120 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
Comment Utility
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
Comment Utility
0
 
LVL 1

Expert Comment

by:shageman
Comment Utility
Sorry DiveBlue....got in just after you
0
 

Author Comment

by:DejanK
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:DejanK
Comment Utility
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
Comment Utility
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

728 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

11 Experts available now in Live!

Get 1:1 Help Now