Link to home
Start Free TrialLog in
Avatar of dsg138
dsg138

asked on

Binding the ProgCtrl ActiveX Control to a value on my form

Experts,
I'm a little new to ActiveX contorls.
One of the values on my form is called "PercentComplete".  It's a numberic value that contains the percent completed of projects in my database.

I've added the Microsoft Progress Contol Bar (ProgCtrl) to my form.  How do I tell the ActiveX Controll to run using the value Me.PercentComplete?

So, if the value is 27% compelte, the bar would visually indicate this.

I'm guessing this would be done in the OnUpdated event of the control, but I'm a little unsure of the syntax.

Thanks in advance,

-Dan
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

You could use the form's Current event, or Load/Open event, depending on exactly what you're doing with the progress bar. If this is a project wide setting, then probably the Load/Open event. I'm not overly familiar with the control you mention, but I'd suspect that you would need to set the .Value of the Progress bar in some fashion.

Also: You'd be well advised to NOT use this control ... it's buggy, and very prone to versioning issues. Many devs build their own progress bar with boxes and such. I've got a sample on my website that shows how to do this:

www.infotrakker.com\ProgSamples\ProgBar.zip

SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
mx: Be careful about posting articles from the Access Advisor. I did this in a newsgroup once and got a nice (and well-deserved) tongue lashing from the author regarding copyrights and such <g>.
good point.  
It was just part of the article ... and I've been a paid subscriber since inception ...  so, if they hassle me, I will do it right back, lol.

mx
Avatar of dsg138
dsg138

ASKER

Thank you both for the suggestions.

LMS, I've downloaded your sample and it's really cool, but way more than I need to do.
MX, I think your solution is also more than I need.  I really don't need timer intervals at all.

Basically, right now, when my users open up my form (a single form), they can see a text box that says PercentComplete.  They will see something that says 85% in the text box.  All I want to do is give them a visual indicator of that 85% for this record.  This should not invove any timers or durations.

I'm thinking it should be as simple as something like this:

ProgBar.Value = me.PercentComplete

But that was just pseudo code and I'm not sure of the syntax.

Thank you both for your help so far.  
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dsg138

ASKER

thanks... Other users will definately be using this.  

So if I used the one from your sample...
what part of the code would I modify to add something like:  
Me.ProgressBar2.Value = Me.PercentComplete.
Is that the vdata value that I'd be modifying?

Didn't realize that was so complex so I'm increasing the points.  Thanks!
"MX, I think your solution is also more than I need.  I really don't need timer intervals at all."

Actually, that was just a little background on how to use the control you are using :-)

mx
Avatar of dsg138

ASKER

MX, thanks for the background.

LSM, I got this to work with the VB code you've provided.  I think this should be fine since all of the users have the same version of Access.  But I will be cautious for versioning issues like you've mentioned.  We'll see how this will do for now.  Thanks again.
<I think this should be fine since all of the users have the same version of Access.>

By "versioning conflicts" I'm referring to conflicts with the ProgressBar, not Access. If your users have an older version of the ProgressBar control on their machines, you'll end up with errors and a non-responsive program at best (crashed system at worst) ... I don't know what your target environment will be, but in general if your users would be running older versions of operating systems (or lower service packs) you could potentially run into some issues. As I mentioned before: you would be much, much better off using a non-ActiveX control for this ... either way, best of luck and glad you got it working.