?
Solved

Progress bar for Access 97

Posted on 2001-08-14
10
Medium Priority
?
1,218 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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 

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 150 total points
ID: 6386792
0
 
LVL 59
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
A quick solution showing how to control and open a POS Cash Register Drawer using VBA with MS Access.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

594 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