I have a simple routine running from the click event of a button on a Access 2000 form. The button does some file operations ultimately updating an Excel spreadsheet of all the PC Users in our company.
Next to the button are some progress labels with tick images next to them which are set to Visible=No at design time. The idea of these labels and ticks is that as each successive operation is peformed by the Visual Basic routine behind the button, each successive label is ticked giving a visual idea of how far through the entire process we are. This is my attempt of mimicking the sort of tick-display you will see when you uninstall some software using UninstallShield. As each operation is done by the Visual basic, a tick is made visible next to the label describing that operation.
My problem is that my lovely ticks do not appear in order when I run the Visual Basic normally (by clicking on the button). They only appear right at the end of the lengthy process, after all the Visual Basic operations have been done. However, when I step through the code in break mode the ticks appear one at a time down the form, perfectly in order and at the right time!
Is this a bug in Access 2000?
My code (greatly simplified) is presented below:-
================ CODE =============================
Private Sub cmdUpdateTable_Click()
Dim fso As Object, excelApp As Object
' After the update button is clicked the Update progress labels are made visible
' on the main form
Forms!frmMain!lbl1.Visible = True
Forms!frmMain!lbl2.Visible = True
Forms!frmMain!lbl3.Visible = True
' Copy UserList.xls from network drive into C:\Data\UserList2.xls
Set fso = CreateObject("Scripting.FileSystemObject"
fso.CopyFile "N:\Admin\UserList.xls", "C:\Data\UserList2.xls"
' Make tick visible next to lbl1 ("UserList.xls copied onto C-drive"
Forms!frmMain!imgTick1.Visible = True
' Open excel and C:\Data\UserList.xls and delete the data in range A1 to D20
Set excelApp = CreateObject("excel.application"
excelApp.Visible = False ' I don't want to see Excel opening
excelApp.Workbooks.Open FILENAME:="C:\Data\UserList.xls", updatelinks:=False
excelApp.Workbooks("UserList.xls".sheets("list".Range("a1:d20".delete
' Make tick visible next to update label 2 ("UserList.xls opened and A1-D20 deleted"
Forms!frmMain!imgTick2.Visible = True
.
.
.
. Etc..........
.
.
.
End Sub
=================================================
Next to the button are some progress labels with tick images next to them which are set to Visible=No at design time. The idea of these labels and ticks is that as each successive operation is peformed by the Visual Basic routine behind the button, each successive label is ticked giving a visual idea of how far through the entire process we are. This is my attempt of mimicking the sort of tick-display you will see when you uninstall some software using UninstallShield. As each operation is done by the Visual basic, a tick is made visible next to the label describing that operation.
My problem is that my lovely ticks do not appear in order when I run the Visual Basic normally (by clicking on the button). They only appear right at the end of the lengthy process, after all the Visual Basic operations have been done. However, when I step through the code in break mode the ticks appear one at a time down the form, perfectly in order and at the right time!
Is this a bug in Access 2000?
My code (greatly simplified) is presented below:-
================ CODE =============================
Private Sub cmdUpdateTable_Click()
Dim fso As Object, excelApp As Object
' After the update button is clicked the Update progress labels are made visible
' on the main form
Forms!frmMain!lbl1.Visible = True
Forms!frmMain!lbl2.Visible = True
Forms!frmMain!lbl3.Visible = True
' Copy UserList.xls from network drive into C:\Data\UserList2.xls
Set fso = CreateObject("Scripting.FileSystemObject"
fso.CopyFile "N:\Admin\UserList.xls", "C:\Data\UserList2.xls"
' Make tick visible next to lbl1 ("UserList.xls copied onto C-drive"
Forms!frmMain!imgTick1.Visible = True
' Open excel and C:\Data\UserList.xls and delete the data in range A1 to D20
Set excelApp = CreateObject("excel.application"
excelApp.Visible = False ' I don't want to see Excel opening
excelApp.Workbooks.Open FILENAME:="C:\Data\UserList.xls", updatelinks:=False
excelApp.Workbooks("UserList.xls".sheets("list".Range("a1:d20".delete
' Make tick visible next to update label 2 ("UserList.xls opened and A1-D20 deleted"
Forms!frmMain!imgTick2.Visible = True
.
.
.
. Etc..........
.
.
.
End Sub
=================================================