I currently have a form that is just a progress bar. It uses an timer on open to basically always run a bar from left to right to show processing data. I have another form that imports an excel file. Here is the code for that:
Private Sub Update_Click()
On Error GoTo Err_Update_Click
With DoCmd
.SetWarnings False
.OpenQuery "updated table delete query"
.SetWarnings True
.TransferSpreadsheet transfertype:=acImport, tablename:="Updated Table", FileName:=Me.BrowseTextBox, HasFieldNames:=True
End With
Exit_CmdImportExcel_Click:
Exit Sub
Err_Update_Click:
MsgBox Err.Description
Resume Exit_Update_Click
Exit_Update_Click:
End Sub
I would like to have the form "progress" open when I click the "update' button, run the above code to import the excel file, and after it's done, close the form "progress". I tried using the DoCmd to open the form at the beginning of the above code and putting a close on the "progress" form at the end of the code. When I do that, I click update, the form "progress" opens, but the progress bar stays idle. Once the excel file is imported the progress bar starts to run. I'm not sure what I need to do to fix the issue. If you need any other code I can provide it. Thank you in advance.
Private Sub Update_Click()
On Error GoTo Err_Update_Click
With DoCmd
.SetWarnings False
.OpenQuery "updated table delete query"
.SetWarnings True
.TransferSpreadsheet transfertype:=acImport, tablename:="Updated Table", FileName:=Me.BrowseTextBox, HasFieldNames:=True
End With
Exit_CmdImportExcel_Click:
Exit Sub
Err_Update_Click:
MsgBox Err.Description
Resume Exit_Update_Click
Exit_Update_Click:
End Sub
I would like to have the form "progress" open when I click the "update' button, run the above code to import the excel file, and after it's done, close the form "progress". I tried using the DoCmd to open the form at the beginning of the above code and putting a close on the "progress" form at the end of the code. When I do that, I click update, the form "progress" opens, but the progress bar stays idle. Once the excel file is imported the progress bar starts to run. I'm not sure what I need to do to fix the issue. If you need any other code I can provide it. Thank you in advance.