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").Control s.Item("St atusLbl"). Caption = StatStr
Forms.Item("Main").Control s.Item("Pe rcLbl").Ca ption = StatPercMidVal & "%"
Forms.Item("Main").Control s.Item("St atusBarPB" ).Value= StatPercMidVal
Forms.Item("Main").Repaint
Call PauseRunFunc (1000000)
Next
End If
Forms.Item("Main").Control s.Item("St atusLbl"). Caption = StatStr
Forms.Item("Main").Control s.Item("Pe rcLbl").Ca ption = StatPercMidVal & "%"
Forms.Item("Main").Control s.Item("St atusBarPB" ).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").Control s.Item("St atusBarPB" ).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
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").Control
Forms.Item("Main").Control
Forms.Item("Main").Control
Forms.Item("Main").Repaint
Call PauseRunFunc (1000000)
Next
End If
Forms.Item("Main").Control
Forms.Item("Main").Control
Forms.Item("Main").Control
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").Control
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, the bottom of the first image got cut off, but it shows the built-in progress bar in the status bar.
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
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.
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.
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.
Jim.