G
Guest
I'm trying to have a label appear right after the button is clicked then
disappear after the process is finished.
Here's the code:
********************
Private Sub btnCreateTable_Click()
On Error GoTo Err_btnCreateTable_Click
Dim stDocName, strSQL As String
' Display test so they know the process has started
Working.Visible = True
' Remove the data already in the table
strSQL = "DELETE ProductsUsedByWorkstation.* FROM
ProductsUsedByWorkstation;"
CurrentDb.Execute strSQL, dbFailOnError + dbSeeChanges
' Append the unique Asset names to the table based on the date range
specified
' If no dates specified, run for all data
strSQL = "INSERT INTO ProductsUsedByWorkstation ( AssetName ) SELECT
DISTINCT DailyDatawithProductandVersion.AssetName FROM
DailyDatawithProductandVersion "
If [BeginDate] > 0 Then
strSQL = strSQL & "WHERE (((DailyDatawithProductandVersion.RunDate)
Between #" & [BeginDate] & "# And #" & [EndDate] & "#));"
End If
CurrentDb.Execute strSQL, dbFailOnError + dbSeeChanges
' Hide "Working" text and display "Completed" text
Working.Visible = False
Completed.Visible = True
Exit_btnCreateTable_Click:
Exit Sub
Err_btnCreateTable_Click:
MsgBox Err.Description
Resume Exit_btnCreateTable_Click
End Sub
************************
The label 'Working' does not appear but the 'Completed' label does.
Help?
disappear after the process is finished.
Here's the code:
********************
Private Sub btnCreateTable_Click()
On Error GoTo Err_btnCreateTable_Click
Dim stDocName, strSQL As String
' Display test so they know the process has started
Working.Visible = True
' Remove the data already in the table
strSQL = "DELETE ProductsUsedByWorkstation.* FROM
ProductsUsedByWorkstation;"
CurrentDb.Execute strSQL, dbFailOnError + dbSeeChanges
' Append the unique Asset names to the table based on the date range
specified
' If no dates specified, run for all data
strSQL = "INSERT INTO ProductsUsedByWorkstation ( AssetName ) SELECT
DISTINCT DailyDatawithProductandVersion.AssetName FROM
DailyDatawithProductandVersion "
If [BeginDate] > 0 Then
strSQL = strSQL & "WHERE (((DailyDatawithProductandVersion.RunDate)
Between #" & [BeginDate] & "# And #" & [EndDate] & "#));"
End If
CurrentDb.Execute strSQL, dbFailOnError + dbSeeChanges
' Hide "Working" text and display "Completed" text
Working.Visible = False
Completed.Visible = True
Exit_btnCreateTable_Click:
Exit Sub
Err_btnCreateTable_Click:
MsgBox Err.Description
Resume Exit_btnCreateTable_Click
End Sub
************************
The label 'Working' does not appear but the 'Completed' label does.
Help?