MS Access Progress Bar

  • Thread starter Thread starter Bartman
  • Start date Start date
B

Bartman

I have some code assigned to a button named "Command35". The button
"Command35" should make 10 lables become visible one at a time and with
each one becoming visible it should change a label text from 20% -
100%. The initial label values have properties set to hidden.

The form name is "PROGRESS1"
The button name is "Command35"
Each hidden label is called "LBL1" to "LBL10"
% label is called "PROGRESS"

When I click the button I get Error message "Runtime error .7874:
Splash screen cant find the object 'query.1'

Code assigned to the button is:

Private Sub Command35_Click()
DoCmd.SetWarnings False

DoCmd.OpenQuery "query1", acViewNormal
Me.LBL1.Visible = True
Me.LBL2.Visible = True
Me.PROGRESS.Caption = "20%"
DoEvents

DoCmd.OpenQuery "query2", acViewNormal
Me.LBL3.Visible = True
Me.LBL4.Visible = True
Me.PROGRESS.Caption = "40%"
DoEvents

DoCmd.OpenQuery "query3", acViewNormal
Me.LBL5.Visible = True
Me.LBL6.Visible = True
Me.PROGRESS.Caption = "60%"
DoEvents

DoCmd.OpenQuery "query4", acViewNormal
Me.LBL7.Visible = True
Me.LBL8.Visible = True
Me.PROGRESS.Caption = "80%"
DoEvents

DoCmd.OpenQuery "query5", acViewNormal
Me.LBL9.Visible = True
Me.LBL10.Visible = True
Me.PROGRESS.Caption = "100%"
DoEvents

DoCmd.SetWarnings True
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.Restore
End Sub

Can anyone see any reason for this not to work? I got it from the web:
http://www.datapigtechnologies.com/flashfiles/progressbar.html
 
Do you have a query named query1?

DoCmd.OpenQuery "query1", acViewNormal is the instruction to run that query.
 
I see what you mean Doug! The code is looking for a real query.
Thank you for your help.

Regards

Bartman
 
Back
Top