Error 2485 Microsoft Access cannot find the object 'Custom rpt' (1 Viewer)

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
I keep getting the following problem.
The following lines cause the error:
Code:
    stDocName = "rptSales"
    DoCmd.OpenReport stDocName, acPreview, , strWhere
I don't have an object in the db called 'Custom rpt' or a reference to it in any of my code.
Any ideas on what might be wrong?
 

Minty

AWF VIP
Local time
Today, 12:01
Joined
Jul 26, 2013
Messages
10,355
What's in your strWhere?

Also have you checked for hidden objects?
 

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
The name of the report that I'm trying to open.
 

Minty

AWF VIP
Local time
Today, 12:01
Joined
Jul 26, 2013
Messages
10,355
I hope not, that should be your filter/where condition ?
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:01
Joined
Jan 23, 2006
Messages
15,364
Bob,
Can you post a zip containing the database? With only a few records -nothing confidential?
 

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
I hope not, that should be your filter/where condition ?
Sorry Minty. I miss read your question. The following code is used to create the WHERE clause:
Code:
    Select Case Me.grpShow
        Case 1 'Do NOT show OMITTED transactions
            strWhere = strFieldName & " >= #" & Format(frm.txtDateFrom, "mm/dd/yyyy") & "# And " & strFieldName & " <= #" & Format(frm.txtDateTo, "mm/dd/yyyy") & "# And Omit = False"

        Case 2 'ONLY show OMITTED trnsactions
            strWhere = strFieldName & " >= #" & Format(frm.txtDateFrom, "mm/dd/yyyy") & "# And " & strFieldName & " <= #" & Format(frm.txtDateTo, "mm/dd/yyyy") & "# And Omit = True"

            
        Case 3 'Include ALL transactions
            strWhere = strFieldName & " >= #" & Format(frm.txtDateFrom, "mm/dd/yyyy") & "# And " & strFieldName & " <= #" & Format(frm.txtDateTo, "mm/dd/yyyy") & "#"

    End Select
 

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
Bob,
Can you post a zip containing the database? With only a few records -nothing confidential?
Thanks for your interest jdraw. I will take a look at doing that.
 

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
Bob,
Can you post a zip containing the database? With only a few records -nothing confidential?
The front and back ends should be attached.
 

Attachments

  • DATA.zip
    34.8 KB · Views: 62
  • Front 8003 - Copy (2).zip
    1.4 MB · Views: 79

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
The front and back ends should be attached.
jdraw. Sorry, should have given you some detail on where to find the error when I posted the zip files.

Open form "frmMainSB"
Click "Sales" button
Click "Preview Report" button.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:01
Joined
Jan 23, 2006
Messages
15,364
Bob,

I didn't set up your database FE and BE. I took the FE and used vTools --and I'm not really familiar with it. I asked it to deep search for Custom rpt.
It churned a way and returned the info attached as jpg.

Seems it could be part of a menubar, but as I said, I don't know the details of vTools.
Does that make any sense to you?

I have now set up your FE/BE and relinked your tables. I get the same error.
I'm trying to get to the recordsource of the report and build a query with the recordsource and where clause... BUT when I go to report design, it is not showing nor letting me select the Recordsource in properties. That is, I can not activate the Data tab in report properties???Had to close everything , then reopen in design view to get Data tab to open--but then see it hs no recordsource --is unbound. My intent was to run a query and see if I also got the error..
 

Attachments

  • Custom_rpt.jpg
    Custom_rpt.jpg
    46.2 KB · Views: 86
Last edited:

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
jdraw. Thank you so much for your time and trouble. I believe your comments will prove to be invaluable once I have time later this week to look at this.

I developed this app for a client some years ago in A2003 and have made various changes and additions to it over the years. I have recently started using A2013 and I am now in the process of making more changes to the app.

I have encountered this problem with several reports and one or two forms already which I put down to corruption. However, your comments have reminded me that in the A2003 versions I had custom menu bars I think, the one for Reports may well have been called "Custom rpt".

Can you tell me if I would be correct in thinking that Custom Menu Bars can not be used in A2013 and that I will need to create some sort of Custom Ribbon instead.

Thanks once again for your help and insight:)
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:01
Joined
Jan 23, 2006
Messages
15,364
Bob,

I have no experience with A2013. I did find this article via Google that my make more sense to you. Earlier Access versions and how they act in A2013


My first thought when you mentioned an unknown "Custom rpt" was some corruption.

Just got back to your db.
I found the recordsource in an event. and built a query (below) using the WHERE clause
Code:
SELECT [tblSales].[SalesID]
	,[tblCo].[CoName]
	,[tblCo].[CoType]
	,[tblSales].[SalesDate]
	,[tblSales].[CoNameID]
	,[tblSales].[Ref]
	,[tblSales].[Amount]
	,[tblSales].[OnAC]
	,[tblSales].[ReceiptID]
	,[tblSales].[Pd]
	,[tblSales].[Omit]
FROM tblCo
INNER JOIN tblSales ON [tblCo].[CoNameID] = [tblSales].[CoNameID]
WHERE SalesDate >= #09 / 07 / 2015 #
	AND SalesDate <= #09 / 07 / 2015 #
	AND Omit = False;

No errors and returns 2 records --FYI.
SalesID CoName CoType SalesDate CoNames Ref Amount OnAC ReceiptID Pd Omit
22044 Bobs Test Cus 07/09/2015 Bobs Test 23604 448.09 Yes 0 No No
22045 Bobs Test Cus 07/09/2015 Bobs Test 23605 25.00 Yes 0 No No
 
Last edited:

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
jdraw. Can't thank you enough. The link you provided looks to be most informative but I will need to study it later this week.
BTW. I have had a closer look at the properties of the reports and there is indeed a reference set to "Custom rpt" in the reports property settings.
Thanks to your input, I am now confident that I am on my way to ending the frustration I have been having for the past couple of weeks trying to sort this out.
I will post back later this week after studying the link you supplied and trying a few things out.
Thanks once again for your interest and help.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:01
Joined
Jan 23, 2006
Messages
15,364
Good luck Bob. Happy to help.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:01
Joined
Jan 23, 2006
Messages
15,364
Bob,

I was closing down some of the forms I had open and came to a message as per the attached jpg. Not sure if you have had this one, or if it's something new.???
 

Attachments

  • ForBob_Custom_SC.jpg
    ForBob_Custom_SC.jpg
    34 KB · Views: 113

zpy2

Registered User.
Local time
Today, 05:01
Joined
Jun 14, 2014
Messages
26
I have encountered this problem with several reports and one or two forms already which I put down to corruption. However, your comments have reminded me that in the A2003 versions I had custom menu bars I think, the one for Reports may well have been called "Custom rpt".

Can you tell me if I would be correct in thinking that Custom Menu Bars can not be used in A2013 and that I will need to create some sort of Custom Ribbon instead.
t:)
that's true.
i add a commandbar named as Custom rpt
try the file below
 

Attachments

  • Front 8003 - Copy20150908.zip
    1.3 MB · Views: 61

bob fitz

AWF VIP
Local time
Today, 12:01
Joined
May 23, 2011
Messages
4,717
Bob,

I was closing down some of the forms I had open and came to a message as per the attached jpg. Not sure if you have had this one, or if it's something new.???
Hi jdraw.
Thanks for the "heads up" on another error. No haven't encountered that one yet but the name sounds like another menu bar for the form.

Will of course be looking out for that one too now :eek:
 

zpy2

Registered User.
Local time
Today, 05:01
Joined
Jun 14, 2014
Messages
26
Can you please explain a little more of what you did and how you did it please.
I just created a commandbar as I posted last time.
please check my upload to find a module with name modCreateCommandbar where you can find detail how to add a commandbar with codes.
I think you probably have not imported custom commandbars when you converted a mdb to accdb.
 

Users who are viewing this thread

Top Bottom