Link to home
Start Free TrialLog in
Avatar of needhelpfast569
needhelpfast569

asked on

create a progress bar in access 2010 64 bit

I have converted my access app from access 2010 32 bit to access 64 bit. Have been able to cure all the conversion problems except the existing progress bar that worked in prior versions does not work and I get the error "There is no object for this control". Which I think means that I'm missing a reference somewhere but not sure if a reference exists to correct the error.

here is the existing code for the function

Function ShwStatus(StatStr As String, StatPerc ad Double)

DoEvents
Dim StatPercVal as Integer
StatPercVal  = Int (StatPerc * 100)

If StatPerc = 0 Then
LastStatusVal = 0
Else

Dim StatPercMidVal As Integer

For StatPercMidVal = LastStatusVal to StatPercVal

Forms.Item("Main").Controls.Item("StatusLbl").Caption = StatStr
Forms.Item("Main").Controls.Item("PercLbl").Caption = StatPercMidVal & "%"
Forms.Item("Main").Controls.Item("StatusBarPB").Value= StatPercMidVal
Forms.Item("Main").Repaint
Call PauseRunFunc (1000000)
Next

End If

Forms.Item("Main").Controls.Item("StatusLbl").Caption = StatStr
Forms.Item("Main").Controls.Item("PercLbl").Caption = StatPercMidVal & "%"
Forms.Item("Main").Controls.Item("StatusBarPB").Value= StatPercMidVal
Forms.Item("Main").Repaint

End function

When the code hits the line below I get the error "There is no object for this control"

Forms.Item("Main").Controls.Item("StatusBarPB").Value= StatPercMidVal

If I comment this line the function works but of course no progress bar

Any suggestions to correct this problem would be great or point in the correct direction.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
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
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
man you beat me to it ...I was just going to post the link.

Jim.
Thanks, Jim.  It's nice to know I'm not the only one that knows about it.  I really need to update the database, I've made a few modifications, and Joe (MX) has converted it to Access 13 using themes.
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
Sorry, the bottom of the first image got cut off, but it shows the built-in progress bar in the status bar.
Avatar of needhelpfast569
needhelpfast569

ASKER

Thanks guys for all your help this will help me get to the fix. I need to add the progress bar into the form. Sorry I did not get back to you but received the information to complete my other 2003 and 2007 versions that I want to finish and get ready to publish to clients. I will get back to this next week and get it done. Again thank you for the help and support.

Rick
Hi Dale,

In your above mentioned article you mention in 4. "multi-step process or a loop" and that I understand, but then a few lines later you say "Frm_Status provides you with the ability to provide process status for a single process, or for imbedded processes." That is what I need, but I don't understand. I ran your neat database, but could not see how that will give me a status if I do no looping. I am using DoCmd.TransferText to import a file and want to show some progress value even if it is not accurate.

Will you please comment on my question titled "Progress indicator while file import is running" posted today.
Unfortunately, none of the various progress bar methods are going to help with a TransferText operation.  This is a single event and to the best of my knowledge none of the progress bar examples will give you a status as it is occuring.

On the other hand, you could write each of the lines that you are doing with TransferText as a separate item, in a loop.  You would use the Open Statement to open a text file for output  and then loop through your recordset using the Write # or Print # statements to write the data to the file.