Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 6th, 2009, 11:39 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default Table of Contents in a Report

Hiya Folks!

I tried following the instructions from MS Article ID 131588 for creating a Table of Contents in an Access report but it doesnt work at all. The first time I tried it, absolutely nothing happened. The second time I tried it, I get a 424 Runtime Error: 'object required' error in the line:

toctable.Seek "=", tocentry

I checked and rechecked all the instructions and everything that the instructions say, i have done.

My report has approx 117 pages, and I am trying to create a Table of Contents that will have more or less the format below (see at the end of this message - I included the example to illustrate how many levels and sublevels in my report):

Any advice!? :)

Thank you!

Odeh

-Restaurant
-----Food
---------Cold Starters-----------1
---------Hot Starters-----------2
---------Meat-----------3
---------Fish-----------4
---------Desserts-----------5
----Drinks
---------Soft Drinks-----------6
---------Red Wine-----------7
---------White Wine-----------8
-----Tabaco
---------Cigarettes-----------9
---------Cigars-----------10

-Bar
-----Food
---------Cold Starters-----------11
---------Desserts-----------12
----Drinks
---------Red Wine-----------13
---------White Wine-----------14

-Terrace
-----Tabaco
---------Cigarettes-----------15
---------Cigars-----------16
Reply With Quote
  #2 (permalink)  
Old March 11th, 2009, 08:19 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I found this article. Does it help?

http://en.allexperts.com/q/Using-MS-...tents-page.htm
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #3 (permalink)  
Old March 23rd, 2009, 04:45 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default Will try and let you know!

Thanks for the link! Will try it and let you know!

Regards!
Reply With Quote
  #4 (permalink)  
Old March 23rd, 2009, 07:14 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default Run-Time Error 424

Hi Again!

I followed the instructiona and I keep receiving the following error message:

Run-Time Error 424 - Object Required

When I click on Debug, it highlights the following line:

TocTable.Seek "=", TocEntry

When I hover the mouse over the following line of the same function (on the part before the '=' symbol, it shows the 'object required' popup window:

TocTable!Description = TocEntry

I checked all the instruction carefully and I did everything as it it says, including to verify that the datatype of the 'description' field and the field that contains the data to go into the Table of Contents are the same.

I added the DAO 3.6 library as well.

I did have the following doubt though - but I am unsure if they are related to the problem: Is a primary key required in the 'Table of Contents' table? Tried to create one but it also didnt work.

The table of contents table is always empty.

Any advice? Thank you!

Last edited by Odeh Naber; March 23rd, 2009 at 07:29 AM.
Reply With Quote
  #5 (permalink)  
Old March 23rd, 2009, 07:39 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default Copy Paste Field to Table of Contents Table

I tried to do the following to see if there is any results - and also to ensure that the two fields are exactly the same:

I opened the table in design view (the one which holds the data that I want to eventually appear in the Table of Contents (TOC) table). I copied the line that has the definition of the field that I want copied to the TOC table and I pasted it in the TOC table. I then renamed it in the TOC table as Description. And I changed the Index option to Yes No Duplicates.

I then tried to preview the report and I get the following runtime error:

Runtime Error 3800: 'Description' is not an index in this table

When I click on the Debug button it highlights the following line:

TocTable.Index = "Description"

I am assuming this is because I have duplicate descriptions in the main table (which I do). I then tried to remove .Index from that line, and I get the first runtime error that I reported earlier: 424.

Any advice?

Thanks!

Last edited by Odeh Naber; March 23rd, 2009 at 07:41 AM.
Reply With Quote
  #6 (permalink)  
Old March 23rd, 2009, 08:01 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What if you index the description field, and then allow duplicates. Would that work? I don't think it needs a PK field to work.
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #7 (permalink)  
Old March 23rd, 2009, 08:12 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi again!

I just tried to do that - and now it gives the Runtime Error 424 (object required) message.

Again it is highlighting the following line in the debugger:

TocTable.Seek "=", TocEntry

Just to add (not sure if this helps in anyway):

With regards to this line: TocTable.Seek "=", TocEntry
when I hover on 'TocTable.Seek', no popups appear.
when I hover on 'TocEntry', a little popup appears with the name of one of the recipes - in this case 'Chicken Soup'.

And with regards to this line: TocTable!Description = TocEntry
when I hover on 'TocTable!Description', this little popup appears:
TocTable!Description = <Object Require>
when I hover on 'TocEntry', a little popup appears with the same name of one of the recipes as happened above - in this case 'Chicken Soup'.

With regards to this line: TocTable![page number] = intPageCounter
when I hover on 'TocTable![page number]', no popups appear.
when I hover on 'intPageCounter', this little popup appears:
intPageCounter = Empty

Any other clues as to what may be causing this? Thanks again!
Reply With Quote
  #8 (permalink)  
Old March 23rd, 2009, 08:15 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Can you do a make table query with Select Distinct, make the Description field Indexed (No Duplicates) in the new table, and then run this on that new table and see if the error recurs?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #9 (permalink)  
Old March 23rd, 2009, 08:36 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default Make Table Query

Sorry to bother you - I never created a make table query before.

So lets see if what I did is correct:

First I deleted the 'Table of Contents' table that we created before, right?

Then I went to Create New Query in Design View, and I selected the table that contains the recipe names (example: Chicken Soup). Then I select from the drop-down option in the toolbar the Make-Table Query. It asks for a table name - I typed in 'Table of Contents'.

Then I ran the query and a new table 'Table of Contents' was created. The Description Field was originally named 'PortugueseDescription' so I changed it to 'Description'. And then I added in the new table the 'Page Number' field. I clicked on my report and I got exactly the same runtime error message 424 - object required.

Is this what you wanted me to try - just to be sure I understood correctly? After I closed the debugger and I checked the table - it was completely empty.

Thanks!
Reply With Quote
  #10 (permalink)  
Old March 23rd, 2009, 08:40 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Sorry, I meant create a new table for the data that your report is being run on. But limit the records to unique items, and then delete some data so that you can index the Description field. Then run the report on that new table. It will still need the TOC table. I wanted to see what would happen if the description field were unique indexed.
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display the arraylist contents into a table yzlin04 ASP.NET 2.0 Basics 2 July 27th, 2007 06:23 AM
Regarding Table of Contents Creation forrestfsu XSLT 7 June 21st, 2007 03:04 PM
Contents of report are blank jtkaylor BOOK: Professional Crystal Reports for VS.NET 1 April 26th, 2006 04:47 PM
table of contents light BOOK: Professional Crystal Reports for VS.NET 0 March 9th, 2005 08:45 AM
User can not view Report Manager contents lidsurfer BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 November 23rd, 2004 12:33 PM



All times are GMT -4. The time now is 10:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.