Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    2115 run time error (Office 2003)

    Hi all,

    Stuck again! I am getting a runtime error 2115 after running the code listed below. The me.refresh line triggers the error. What I can't seem to grasp here is that if I remove that line and just close the form, the table updates and there is no error. However, I need the form to stay open and when I refresh or requery the form, I get the error. Can someone give me a pointer on how to fix this issue.

    Thanks
    Kevin

    Code:

    Private Sub Check354_AfterUpdate()
    DoCmd.SetWarnings False

    'DoCmd.Requery

    ' Attach TAR Report
    If (Forms![Splash Screen]![vSecurity] = 70) Then
    If Me!Check354 = True Then

    Dim mySQL As String
    Dim vPricingPackage As String
    vPricingPackage = Forms![Splash Screen]![vLastPricing]


    DoCmd.OpenForm "frmSelectFileXP", acNormal, , , , acDialog

    oleTechnicalReport.Class = "Excel.Sheet" ' Set class name.
    ' Specify type of object.
    oleTechnicalReport.OLETypeAllowed = acOLELinked
    ' Specify source file.
    oleTechnicalReport.SourceDoc = Me.vTARReportName
    ' Specify data to create link to.
    'TechnicalReport.SourceItem = "R1C1:R25C15"
    ' Create linked object.
    oleTechnicalReport.Action = acOLECreateLink
    ' Adjust control size.
    oleTechnicalReport.SizeMode = acOLESizeZoom

    Me.Desk_TAR_Complete = True


    Forms![Splash Screen]![vTechReportName] = Me.vTARReportName

    End If
    End if
    Me.Refresh

    ... more code
    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 2115 run time error (Office 2003)

    Do you get the same error if you use the following line?

    RunCommand acCmdSaveRecord

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: 2115 run time error (Office 2003)

    Thanks Hans,

    Just tried that on and I get the same message.

    kevin
    Kevin

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 2115 run time error (Office 2003)

    There must be something else preventing you from saving the record, but I have no way of knowing what it is without seeing the database. Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: 2115 run time error (Office 2003)

    Hans,

    Before I do that, (huge under taking), I tried eliminating parts of that event one at a time. and if I leave everything else alone and just comment out the OLE lines (as below)...

    ...
    Private Sub Check354_AfterUpdate()
    DoCmd.SetWarnings False

    'DoCmd.Requery

    ' Attach TAR Report
    If (Forms![Splash Screen]![vSecurity] = 70) Then
    If Me!Check354 = True Then

    Dim mySQL As String
    Dim vPricingPackage As String
    vPricingPackage = Forms![Splash Screen]![vLastPricing]


    DoCmd.OpenForm "frmSelectFileXP", acNormal, , , , acDialog

    ' oleTechnicalReport.Class = "Excel.Sheet" ' Set class name.
    ' Specify type of object.
    ' oleTechnicalReport.OLETypeAllowed = acOLELinked
    ' Specify source file.
    ' oleTechnicalReport.SourceDoc = Me.vTARReportName
    ' Specify data to create link to.
    'TechnicalReport.SourceItem = "R1C1:R25C15"
    ' Create linked object.
    ' oleTechnicalReport.Action = acOLECreateLink
    ' Adjust control size.
    ' oleTechnicalReport.SizeMode = acOLESizeZoom

    Me.Desk_TAR_Complete = True


    Forms![Splash Screen]![vTechReportName] = Me.vTARReportName

    End If

    RunCommand acCmdSaveRecord

    ... more code

    It works fine. Is there something unique that I might be missing as far as the OLE routine? Am I better off having the users get to the report some other way than linking to it in this way?

    Thanks

    Kevin
    Kevin

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: 2115 run time error (Office 2003)

    You could simply open the workbook, for example using Application.FollowHyperlink or ShellExecute (do a search in this forum for examples of the latter).

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: 2115 run time error (Office 2003)

    Thanks Hans,

    I will pick up with that in the morning.

    Kevin
    Kevin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •