T
tighe
All,
how can, with the code below, have the f![Location] = Filename line to only
run if everything else occured?
Function SaveAppItem()
Set f = Screen.ActiveForm
surl = f![Hyperlink]
Filename = "\\Bcp\bcp\cmcc\cmcdb\20080922_CMCDB2\Documents\CE\Appendix\" &
f![UpdateNum] & ".pdf"
'With CreateObject("Wscript.Shell")
'Shell ("explorer.exe Filename")
Sleep (3000)
Dim oIExplorer: Set oIExplorer = CreateObject("InternetExplorer.Application")
oIExplorer.Navigate surl
oIExplorer.Visible = True
Sleep (3000)
Do: Loop Until oIExplorer.ReadyState = READYSTATE_COMPLETE
Sleep (2000)
'AppActivate ("InternetExplorer.Application")
'WshShell.AppActivate ("InternetExplorer.Application")
Sendkeys "+^{s}", True
Sleep (2000)
Sendkeys (Filename), True
Sleep (2000)
Sendkeys "{Enter}", True
Sleep (3000)
oIExplorer.Quit
f![Location] = Filename ' this event as long as everything occured
DoCmd.RunCommand (acCmdSaveRecord)
End Function
how can, with the code below, have the f![Location] = Filename line to only
run if everything else occured?
Function SaveAppItem()
Set f = Screen.ActiveForm
surl = f![Hyperlink]
Filename = "\\Bcp\bcp\cmcc\cmcdb\20080922_CMCDB2\Documents\CE\Appendix\" &
f![UpdateNum] & ".pdf"
'With CreateObject("Wscript.Shell")
'Shell ("explorer.exe Filename")
Sleep (3000)
Dim oIExplorer: Set oIExplorer = CreateObject("InternetExplorer.Application")
oIExplorer.Navigate surl
oIExplorer.Visible = True
Sleep (3000)
Do: Loop Until oIExplorer.ReadyState = READYSTATE_COMPLETE
Sleep (2000)
'AppActivate ("InternetExplorer.Application")
'WshShell.AppActivate ("InternetExplorer.Application")
Sendkeys "+^{s}", True
Sleep (2000)
Sendkeys (Filename), True
Sleep (2000)
Sendkeys "{Enter}", True
Sleep (3000)
oIExplorer.Quit
f![Location] = Filename ' this event as long as everything occured
DoCmd.RunCommand (acCmdSaveRecord)
End Function