Good morning all,
I have the following code that works perfectly for what it is intended for, but I need to add a string in it, that copies a file from a network share, to an application path folder and can't seem to find a working way to do so. Hoping you can help out.
It would need to go in before the Set objShell = VBA.CreateObject("wscript.shell") line.
I have the following code that works perfectly for what it is intended for, but I need to add a string in it, that copies a file from a network share, to an application path folder and can't seem to find a working way to do so. Hoping you can help out.
It would need to go in before the Set objShell = VBA.CreateObject("wscript.shell") line.
VBA Code:
Sub UpdateSeparatedUserInfo()
Dim objShell As Object
Dim strGLReport As String
Dim blnContinue, strQuestion
Dim objExcel
strQuestion = "This action will restrict all database activity until completed. " _
& "Do you wish to continue?"
blnContinue = MsgBox(strQuestion, vbYesNo, "Update Separated User Info")
If blnContinue = vbNo Then
Forms![_Navigation Form].NavBtnSeparatedUsersMonitors.SetFocus
Exit Sub
End If
Set objShell = VBA.CreateObject("wscript.shell")
strGLReport = Application.CurrentProject.Path & "\G-L\Gains and Loss Report.xlsx"
' MyFunctions.SleepNow 3000
Forms![_Navigation Form].NavigationSubform.Form.Requery
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [tbl GainsandLoss]"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tbl GainsandLoss", strGLReport, True
DoCmd.SetWarnings True
Forms![_Navigation Form].NavigationSubform.Form.Requery
End Sub