Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report with Subreport - one-to-many? 1

Status
Not open for further replies.

lorirobn

MIS
Mar 15, 2005
450
US
Hello,

I have a report which uses a subreport. When I run the report, I get "Enter Parameter Value" error message for "tblGuestRoom". I click ok and the report seems to work fine.

I have narrowed down this error to the Link Master Fields property setting by setting up the exact same scenario with a form instead of a report. That way, the error message is more precise, and is 'The Link Master fields property setting has produced this error: The object doesn't contain the Automation object 'tblGuestRoom'.

Here is the picture of how things are set up:
--Main report is "rptReport1". RecordSource is "qryQuery1", which uses 2 tables: tblGuestRoom, the table coming up in the error, and tblBathroom. They both have primary key of RoomNumber.
--Subreport is "rsubReport1". RecordSource is tblWindow. From tblGuestRoom to tblWindow is a one-to-many relationship, on key RoomNumber. The idea is to display one report page per room number, with the subreport displaying window 1, window 2, etc., per room number. When I tested this using forms, the error came up when I attempted to scroll to window 3, for a room with only 2 windows. I think the problem lies right here. Perhaps I didn't set my relationships up correctly, Link Master, and it doesn't know the one-to-many relationship?? (although seems to be displaying fine).

On the main report, properties for subreport are as follows: SourceObject = the subreport. I set up Link Child Fields (tblBed.RoomNumber), and Link Master Fields (tblGuestRoom.RoomNumber). In Relationships, there is a 1 to many relationship between tblGuestRoom and tblBed. Does the subreport know this, or do I need to tell it that somehow? Where do I tell it this? I suspect that this is where my problem lies.

Thank you in advance for any help,
Lori
 
This is a simple problem but I do not wish to write an encyclopaedia. If you want help, upload a zipped sample copy of the database with a few records and I will provide the solution.
 
Did my response in the public NGs work? As a reminder from my response there:
I would first make sure that your main report's record source has only one copy of the field RoomNumber. Then change the Link Master property to only:
RoomNumber

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Yes, Duane, this was it! Thank you! It's working fine now. So simple... yet never would have thought of that.
(stupid question, but what does NGs stand for????).
THANKS,
Lori
 
NGs = News Groups

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top