|
|
Code Event Criteria
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
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 2:12:57 PM |
|
Hi tighe,
I think you can try inserting a doevents commands before the f![Location] =
Filename line so
....all your function
Sleep (2000)
Sendkeys "{Enter}", True
Sleep (3000)
oIExplorer.Quit
doevents
f![Location] = Filename ' this event as long as everything occured
DoCmd.RunCommand (acCmdSaveRecord)
End Function
HTH Paolo
"tighe" wrote:
> 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
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 2:58:32 PM
|
|
paolo,
thank you. i also decided to check the file that is suppoosed to be created
and have a msg box depending on results.
"Paolo" wrote:
> Hi tighe,
> I think you can try inserting a doevents commands before the f![Location] =
> Filename line so
>
> ...all your function
> Sleep (2000)
> Sendkeys "{Enter}", True
> Sleep (3000)
>
> oIExplorer.Quit
> doevents
> f![Location] = Filename ' this event as long as everything occured
> DoCmd.RunCommand (acCmdSaveRecord)
>
> End Function
>
> HTH Paolo
>
> "tighe" wrote:
>
> > 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
|
|
0
|
|
|
|
Reply
|
Utf
|
6/3/2010 4:32:18 PM
|
|
|
2 Replies
388 Views
(page loaded in 0.948 seconds)
Similiar Articles: Outline codes - microsoft.public.access.modulesdaovbaI need to create an outline code that ollows the format A.1.a. It ... An IMP has only Events, Achievements, and Criteria. If you can complete all the criteria, you ... I am using a tree control (MSComctlLib.TreeCtrl.2) in a form ...To enter code into events of the treeview control, select the treeview control in the ... the query which is your form's recordsource, add the following in the criteria ... Pause code issue - microsoft.public.access.formscoding... including the form that pops up (frmCriteria) and pauses the code so the user can set the criteria. ... Close the form in the Report's Close event: DoCmd.Close acForm ... change query criteria dynamically with value from a 2nd form ...I want to pass the criteria to the same query from a ... same query from a different form from the click event ... My code in the query design looks like From Form ... specified criteria with outputto? - microsoft.public.access ...For (a), in the Criteria row of the report's source query under the [Ref ID] field ... I use DoCmd.OpenReport and the Load event code gets executed. But when I use the DoCmd ... SendObject VBA (but more elegant) - microsoft.public.access ...As there is no “where” clause on the SendObject event I have come up with the code below that ... Forms]![FormName]![FieldName]> > directly to the query's criteria line ... setfocus not working? - microsoft.public.access.modulesdaovba ...I have VBA code which is run in the AfterUpdate event for a text box. It basically checks to see if the data entered in the text box matches a criteria. Personalize msgbox if criteria not found - microsoft.public.access ...Code the Form's Open event: If Me.RecordsetClone.RecordCount = 0 then MsgBox "Criteria not found ... etc." Cancel = True End If If there ae no records returned, the ... Changing ControlSource property on a subform - microsoft.public ...The OnOpen event for a report reassigns the .ControlSource property for a given bound control based on certain criteria. ... So I tried >the code below on ... How to validate sum of fields (access 2003) - microsoft.public ...I've tried putting this piece of code in the (main/sub) form's properties (namely, in the before/after update event) but ... want to validate the sum of those four criteria ... Verification Procedures Print Criteria†*Diseases in bold have been designated by CSTE as nationally notifiable and should be reported to CDC on a regular basis. Page 1 of 25 2011 Event Code List Nationally ... UTHCPC Procedures - Sentinel and High Risk EventsHigh risk event criteria. The following describes criteria for identifying high risk events: Code blue C IGNA M EDICAL C OVERAGE P OLICY[HM]) (Current Procedural Terminology [CPT] code 93224, 93225 ... 5459 (21%) had arrhythmic events meeting physician notification criteria during a mean monitoring period ... Adverse Event - National Institutes of Health (NIH)Common Terminology Criteria for Adverse Events - Instructions and Guidelines ... The following features are found within Adverse Events: MedDRA and Provisional Codes How to Detect Autofilter Criteria Change Event with Excel VBA ...... Changing a autofilter criteria is not a real change on the worksheet. As a second option, I have tried the “Worksheet_SelectionChange” event. Here is a simple code ... 7/14/2012 10:10:15 PM
|
|
|
|
|
|
|
|
|