Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: run-time error, problem with OLE object...


Message #1 by "Catherine Michel" <michelc@b...> on Wed, 15 May 2002 20:16:05
Hi!
I have an ADP project and when I want to open a report 
(from a form) I have this error message:
Run-time error 2757:
There was a problem accessing a property or method of the 
OLE object.
This error occurs at this line of the code of my form:
DoCmd.OpenReport "rptStatsReport01", acViewPreview, , 
strCriteria
Any help would be very appreciated!
Thanks
Catherine
Message #2 by PStreeter@C... on Sun, 14 Apr 2002 1:00:09 CST
Look at  this from Microsoft support. Good luck figuring 
our what it means. - PGS

http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q202868

On Wed, 15 May 2002 20:16:05 "Catherine Michel" wrote:

> Hi!
> I have an ADP project and when I want to open a report 
> (from a form) I have this error message:
> Run-time error 2757:
> There was a problem accessing a property or method of the 
> OLE object.
 ......


Message #3 by Tad Groves <tegrovesjr@r...> on Wed, 15 May 2002 12:31:26 -0700 (PDT)
What ole object is on the report.  I think it sounds like there is no
data for the ole object, so I would cancel the report on nodata. 


--- Catherine Michel <michelc@b...> wrote:
> Hi!
> I have an ADP project and when I want to open a report 
> (from a form) I have this error message:
> Run-time error 2757:
> There was a problem accessing a property or method of the 
> OLE object.
> This error occurs at this line of the code of my form:
> DoCmd.OpenReport "rptStatsReport01", acViewPreview, , 
> strCriteria
> Any help would be very appreciated!
> Thanks
> Catherine


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
Message #4 by "Catherine Michel" <michelc@b...> on Wed, 15 May 2002 20:50:06
Thanks for your reply!
I have already cancel the report in the nodata sub.

> What ole object is on the report.  I think it sounds like there is no
data for the ole object, so I would cancel the report on nodata. 


--- Catherine Michel <michelc@b...> wrote:
> Hi!
> I have an ADP project and when I want to open a report 
> (from a form) I have this error message:
> Run-time error 2757:
> There was a problem accessing a property or method of the 
> OLE object.
> This error occurs at this line of the code of my form:
> DoCmd.OpenReport "rptStatsReport01", acViewPreview, , 
> strCriteria
> Any help would be very appreciated!
> Thanks
> Catherine


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
Message #5 by Tad Groves <tegrovesjr@r...> on Wed, 15 May 2002 12:48:08 -0700 (PDT)
Did that fix you problem.  If not can you send the code behind the
report ?


--- Catherine Michel <michelc@b...> wrote:
> Thanks for your reply!
> I have already cancel the report in the nodata sub.
> 
> > What ole object is on the report.  I think it sounds like there is
> no
> data for the ole object, so I would cancel the report on nodata. 
> 
> 
> --- Catherine Michel <michelc@b...> wrote:
> > Hi!
> > I have an ADP project and when I want to open a report 
> > (from a form) I have this error message:
> > Run-time error 2757:
> > There was a problem accessing a property or method of the 
> > OLE object.
> > This error occurs at this line of the code of my form:
> > DoCmd.OpenReport "rptStatsReport01", acViewPreview, , 
> > strCriteria
> > Any help would be very appreciated!
> > Thanks
> > Catherine
> 
> 
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
Message #6 by "Catherine Michel" <michelc@b...> on Wed, 15 May 2002 21:01:58
This is the code behind the report.


Option Compare Database
Option Explicit

Private Function GetCriteria() As String

    GetCriteria = gstrCriteria
    
End Function

Private Sub Report_NoData(Cancel As Integer)
'If the report return no data
    MsgBox "No data for this report."
    Cancel = True
End Sub

Private Sub Report_Open(Cancel As Integer)
    Dim strGroupID As String
    Dim strLanguageID As String
    Dim strStartDate As String
    Dim strEndDate As String
    Dim lngLanguageID As Long
    
    lngLanguageID = 21
    
    'Enter the input parameter
    strGroupID = modGlobal.lngGroupID & "{ENTER}"
    SendKeys strGroupID, False
    
    strLanguageID = lngLanguageID & "{ENTER}"
    SendKeys strLanguageID, False
    
    strStartDate = Form_frmTransaction.txtStart & "{ENTER}"
    SendKeys strStartDate, False
    
    strEndDate = Form_frmTransaction.txtEnd & "{ENTER}"
    SendKeys strEndDate, False
    
End Sub
> Did that fix you problem.  If not can you send the code behind the
report ?


--- Catherine Michel <michelc@b...> wrote:
> Thanks for your reply!
> I have already cancel the report in the nodata sub.
> 
> > What ole object is on the report.  I think it sounds like there is
> no
> data for the ole object, so I would cancel the report on nodata. 
> 
> 
> --- Catherine Michel <michelc@b...> wrote:
> > Hi!
> > I have an ADP project and when I want to open a report 
> > (from a form) I have this error message:
> > Run-time error 2757:
> > There was a problem accessing a property or method of the 
> > OLE object.
> > This error occurs at this line of the code of my form:
> > DoCmd.OpenReport "rptStatsReport01", acViewPreview, , 
> > strCriteria
> > Any help would be very appreciated!
> > Thanks
> > Catherine
> 
> 
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
Message #7 by "Carnley, Dave" <dcarnley@a...> on Wed, 15 May 2002 15:43:56 -0500
what those MS support page are telling you is, that Access is hiding the
real error message from you.  This is not a matter of having an OLE control
on the report. The report is based on a linked table.  There is some kind of
issue with that table.  Try creating a query (view) that extracts the same
data your report would extract, and execute that interactively in Access.
This may allow Access to display the error message.  Once you see that error
message, then we can try to fix that.

-----Original Message-----
From: Catherine Michel [mailto:michelc@b...]
Sent: Wednesday, May 15, 2002 4:02 PM
To: Access
Subject: [access] Re: run-time error, problem with OLE object...


This is the code behind the report.


Option Compare Database
Option Explicit

Private Function GetCriteria() As String

    GetCriteria = gstrCriteria
    
End Function

Private Sub Report_NoData(Cancel As Integer)
'If the report return no data
    MsgBox "No data for this report."
    Cancel = True
End Sub

Private Sub Report_Open(Cancel As Integer)
    Dim strGroupID As String
    Dim strLanguageID As String
    Dim strStartDate As String
    Dim strEndDate As String
    Dim lngLanguageID As Long
    
    lngLanguageID = 21
    
    'Enter the input parameter
    strGroupID = modGlobal.lngGroupID & "{ENTER}"
    SendKeys strGroupID, False
    
    strLanguageID = lngLanguageID & "{ENTER}"
    SendKeys strLanguageID, False
    
    strStartDate = Form_frmTransaction.txtStart & "{ENTER}"
    SendKeys strStartDate, False
    
    strEndDate = Form_frmTransaction.txtEnd & "{ENTER}"
    SendKeys strEndDate, False
    
End Sub
> Did that fix you problem.  If not can you send the code behind the
report ?


--- Catherine Michel <michelc@b...> wrote:
> Thanks for your reply!
> I have already cancel the report in the nodata sub.
> 
> > What ole object is on the report.  I think it sounds like there is
> no
> data for the ole object, so I would cancel the report on nodata. 
> 
> 
> --- Catherine Michel <michelc@b...> wrote:
> > Hi!
> > I have an ADP project and when I want to open a report 
> > (from a form) I have this error message:
> > Run-time error 2757:
> > There was a problem accessing a property or method of the 
> > OLE object.
> > This error occurs at this line of the code of my form:
> > DoCmd.OpenReport "rptStatsReport01", acViewPreview, , 
> > strCriteria
> > Any help would be very appreciated!
> > Thanks
> > Catherine
> 
> 
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

  Return to Index